Can you please show how to code for a checkbox list in a RowEditTemplate...I'm using a Sql data source to populate checkbox list. Thx!
Hello davefevold ,
I’ve prepared a sample with the approach David suggested(using Nwind database). Feel free to modify it and don’t hesitate to ask if you have any questions.
Best Regards,
Maya Kirova
Developer Support Engineer
Infragistics, Inc.
http://ko.infragistics.com/support
Dave, below is the code that I'm using...please let me know if I'm missing something.
<ig:BoundDataField DataFieldName="Dray_Type" DataType="System.String" Key="Dray_Type" Width="100px"> <Header Text="Dray Type" /></ig:BoundDataField>
<ig:RowEditingClientBinding ColumnKey="Dray_Type" ControlID="wddDrayType" GetValueJavaScript="$find({ClientID}).get_currentValue()" SetValueJavaScript="$find({ClientID}).set_currentValue({value},true)" />
<td class="style12"> <b>Dray Type:</b></td><td class="style13"> <ig:WebDropDown ID="wddDrayType" runat="server" TabIndex="3" Height="20px" Width="110px" DataSourceID="sdsDrayType" TextField="DrayTypeDesc" ValueField="DrayType" DisplayMode="DropDownList" DropDownOrientation="Default" DropDownContainerHeight="500px" DropDownContainerWidth="300px" EnableMultipleSelection="true" MultipleSelectionType="Checkbox" EnableDropDownAsChild="true" ClientEvents-Initialize="setZIndex" DropDownItemBinding-TextField="DrayTypeDesc" DropDownItemBinding-ValueField="DrayType" > </ig:WebDropDown></td>
<asp:SqlDataSource ID="sdsDrayType" runat="server" ConnectionString="<%$ ConnectionStrings:csDrayage %>" SelectCommand="SELECT DISTINCT [Dray_Type] AS DrayType, [Dray_Type_Desc] AS DrayTypeDesc FROM [DrayType] WHERE ([Deleted_Id] IS NULL) ORDER BY [Dray_Type_Desc]"></asp:SqlDataSource>
function setZIndex(sender, args) { sender.behavior.set_zIndex(1000000);}
Hi,
It is possible that the drop down is showing, but its z-index is less than that of the row edit template div. They both use our drop down framework. Could you maybe handle the opening client event on the drop down and try to set a bigger z-index on the drop down itself?
-Dave
Thanks for the reply David. I tried using the WebDropDown within the RowEditTemplate but I could not make the control drop down...I could get it to work outside of the RowEditTemplate but not inside of it...any thoughts as to why?
Hi davefevold,
Are you trying to use a checkbox list for one column? To choose among multiple items and then have them concactenated with a comma? One option would be to use a WebDropDown. You could turn on checkbox selection to accomplish this. If you do want this, there is no default code for it in the grid. You would have to code it yourself. You'd need a function that takes in the value, splits it, and then checks the appropriate checkboxes. And going back, you'd need to iterate through the checkboxes to build the string to give to the grid.
regards,David Young