Ext.Net Grid Checkbox Column Problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Ext.Net Grid Checkbox Column Problem

    Hi ........

    I am Facing a problem while using ext grid panel with a checkbox column inside it. Assigned DataIndex datatype as boolean and its working fine when binding Boolean Data.But the problem is when I'm using oracle as backend (There is no Boolean Datatype,hence used char)....
    Anyway i want to bind the data from DB in Grid..All other fields get binded..except checkbox....

    Is there any other option to set the checkbox checked , unchecked based on a char value while binding Grid with the store...?


    Pls Help...............................
  2. #2
  3. #3

    CheckBox Binding Problem in side Grid

    Hi Viladimir ....

    Thanks for your reply........

    I tried as shown in the sample..but still now i cant overcome


                DataTable table1 = new DataTable("GridTable");
                DataColumnCollection columns1 = table1.Columns;
    
                DataColumn Column1 = columns1.Add(ID_FIELD, typeof(System.Int32));         
                columns1.Add(FORMNAME_FIELD, typeof(System.String));
                columns1.Add(ADDRIGHTS_FIELD , typeof(System.Boolean   ));
    
    
    
                   <ext:RecordField Name="FORMNAME" />
                 <ext:RecordField Name="addrights" Type ="Boolean"   >
                   <Convert Handler="return value === 'Y';" />
                   </ext:RecordField> 
    
                 Returned Datatable From DB
    
                   /----------------------------/
    
                    N	1	New Mail Entry
                    Y	2	Mail View
                    Y      3	Mail Attachment Details
    
                   /------------------------------/
    
          But still i cant achieve it in screen...when i see in explorer ,checkbox remains unchecked....
  4. #4
    Well, in this case, i guess you bind data without that values
    Please check your DataTable before binding. Are sure that the following line is correct?
    columns1.Add(ADDRIGHTS_FIELD , typeof(System.Boolean));
    I don't think that 'typeof(System.Boolean)' is required if you return 'char' from DB
  5. #5
    i have used conversion in oracle query and tried converting it to a char value

    SELECT TF.formid,TF.FormName,decode(TR.addrights,1,'Y',0,'N') as addrights FROM tblformdetails TF
    Even it returns a char value , as shown in my previous example , it does not affect the CheckBox Column

    Even i tried without typed Dataset, it doesn't affect

      OleDbCommand command = new OleDbCommand("CRUD_Sample.GetSampleData");
                    command.Connection = oracleConn;
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.Add("p_id", OleDbType.Integer).Value = UserID;
                    OleDbDataAdapter da = new OleDbDataAdapter(command);
                    da.Fill(ds, "TblModulesForms");
    Binding Grid as follows.....
        
               Store1.DataSource =ds.Tables[0];
                Store1.DataBind();
  6. #6
    How values are represented in DataTable before binding?
    Also, how the data is serialized (you can find it in the browser source page)

Similar Threads

  1. Replies: 5
    Last Post: Dec 26, 2011, 5:39 AM
  2. Replies: 3
    Last Post: Aug 12, 2011, 5:56 PM
  3. Replies: 2
    Last Post: Mar 22, 2011, 3:40 PM
  4. [CLOSED] Problem using CheckBox as a Filter column.
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 13, 2010, 1:19 PM
  5. Replies: 3
    Last Post: Nov 19, 2009, 9:17 AM

Posting Permissions