Infragistics webdatagrid

1k Views Asked by At

how to write the following code into server side.that is aspx.cs page. I am just beginner. I wrote all the grid definitions into server side.I am trying to insert the checkbox column into infragistics webdatagrid.

<ig:WebDataGrid 
    ID="wdg" 
    runat="server" 
    DataKeyFields="Id"   <-- change with your primary key
    Width="400">
    <Columns>
        <ig:UnboundCheckBoxField Key="Checked" Header-Text="Select" Width="50" headerCheckBoxMode="BiState">
        <Header Text="Select"></Header>
        </ig:UnboundCheckBoxField>
    </Columns>
1

There are 1 best solutions below

0
On

You can define and add the UnboundCheckBoxField to your grid on the server-side like this:

UnboundCheckBoxField field = new UnboundCheckBoxField();
field.Key = "Checked";
field.HeaderCheckBoxMode = Infragistics.Web.UI.CheckBoxMode.BiState;
field.Width = new Unit(50);
field.Header.Text = "Select";
wdg.Columns.Add(field);