Hi!
I have a grid with Row Adding enabled. I have defined DropDownProviders to some columns. What I haven't been able to implement is a way to get values from other dropdowns on the page as default values of the Insertion Row dropdowns. Here's the detailed explanation of the situation:
- I have dropdown on my page which binds to a datasource (say _ddProject)
- I have databound grid with Project as one column
- I have DropDownProvider in the Insertion Row which uses the same datasource than _ddProject
How can I use the _ddProject.SelectedValue as the selected value of Insertion Row dropdown?
Dropdowns have CurrentValue, but I haven't been able to set it by using code like this:
<ig:DropDownProvider ID="BranchProvider">
<EditorControl EnableDropDownAsChild="False" DataSourceID="SqlDataSource" TextField="name" ValueField="name" CurrentValue='<%= _dropdown.SelectedValue %>'>
<DropDownItemBinding TextField="name" ValueField="name"/>
</EditorControl>
</ig:DropDownProvider>
Is it possible to set the CurrentValue to match a value of a control somewhere on your page or do I have to do this on client side on TemplateOpened event?
Hello AriV,
The current value is automatically set to the editor control of the DropDownProvider for each cell. When using "<% =" and "%>" is for getting a particular field in the datasource databind to however the grid will automatically set the current value of the dropdown.
I attached a sample for this in particular.
Let me know if you have any questions with this matter. Thank you.