Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
120
Add and delete rows to unbound WebDataGrid
posted

Hi,

I have a WebDataGrid with 6 unbound columns. One of the column is a template column with a button. Another column is attached to a dropdown editor provider with DataSourceId set, but the underlying column is unbound. Now i want to be able to enter a search criteria in one of the columns, then click the button to populate the dropdown based on the search filter. Now if i select item from the dropdown, it should populate the other columns. Adding and Deletiing of rows should be done using code. Please i need help on this. I have enclosed some mark up scripts below:

 

<ig:WebDataGrid ID="wdgSplitTo" runat="server" Height="350px" Width="100%" AutoGenerateColumns="False">

 <Columns>


<ig:UnboundField Key="Search" Width="120px">

 <Header Text="SEARCH" />

</ig:UnboundField>

<ig:TemplateDataField Key="Button">

<Header Text="..." />

</ig:TemplateDataField>

<ig:UnboundField Key="HolderName">

<Header Text="HOLDER NAME" />

</ig:UnboundField>

<ig:UnboundField Key="NAME">

<Header Text="SELECTED HOLDER" />

</ig:UnboundField>

<ig:UnboundField Key="SPLIT_UNIT">

<Header Text="SPLIT UNIT" />

</ig:UnboundField>

<ig:UnboundField Key="ACCOUNT_NUMBER">

<Header Text="ACCOUNT NUMBER" />

</ig:UnboundField>

</Columns>

<EditorProviders>

<ig:DropDownProvider ID="ddp_wdgSplitTo">

<EditorControl runat="server" ClientIDMode="Predictable" DataSourceID="sqldsSplitHolder"

DropDownContainerMaxHeight="200px" EnableAnimations="False" EnableDropDownAsChild="False" TextField="NAME" ValueField="ACCOUNT_NUMBER" >

<DropDownItemBinding TextField="NAME" ValueField="ACCOUNT_NUMBER" />

</EditorControl>

</ig:DropDownProvider>

</EditorProviders>

<Behaviors>

<ig:RowSelectors RowNumbering="True">

</ig:RowSelectors>

<ig:Activation>

</ig:Activation>

<ig:EditingCore>

<Behaviors>

<ig:CellEditing>

<ColumnSettings>

<ig:EditingColumnSetting ColumnKey="HolderName" EditorID="ddp_wdgSplitTo" />

</ColumnSettings>

</ig:CellEditing>

<ig:RowAdding>

<ColumnSettings>

<ig:RowAddingColumnSetting ColumnKey="HolderName" EditorID="ddp_wdgSplitTo" />

</ColumnSettings>

</ig:RowAdding>

</Behaviors>

</ig:EditingCore>

</Behaviors>

</ig:WebDataGrid>

Parents
No Data
Reply
  • 17590
    Offline posted

    Hello Ikenna Ononuju,

    Thank you for posting in the community!

    I am attaching a small sample illustrating loading of unbound field values in WebDataGrid based on selection of a dropdown provider. For handling changes in the provider, its SelectionChanged event is handled where the active row of the grid itself may be observed. Depending on the new value of the DropDownProvider the new value for "ValueToSet" column is set.

    By design WebDataGrid rquires underlying datasource in all scenarios. The number of the rendered rows in the grid depends on the records in the datasource even if or all of the fields are not displayed in the grid. For adding or deleting rows in WebDataGrid its`s datasource has to be modified directly. All the changes should be performed in the datasource and that the grid should be rebound afterwards.

    Feel free to contact me if you have any additional questions. 

    GridEditorProviders.zip
Children