4 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 15 May 2013, 07:48 AM
Hi,
I guess you want to add a selected column text inside the RadListBox on checkbox check.
C#:
Thanks,
Shinu.
I guess you want to add a selected column text inside the RadListBox on checkbox check.
C#:
protected void CheckBox1_CheckedChanged(object sender, EventArgs e){ CheckBox chk = (CheckBox)sender; GridDataItem Data = (GridDataItem)chk.NamingContainer; string Value= Data["UniqueName"].Text; RadListBox list = (RadListBox)Data.FindControl("RadlistBox1"); RadListBoxItem item = new RadListBoxItem(Value, Value); list.Items.Add(item);}Thanks,
Shinu.
0
Hilmi
Top achievements
Rank 1
answered on 15 May 2013, 08:06 AM
<Columns>
<telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server"
AutoPostBack="True" />
</ItemTemplate>
<HeaderTemplate>
<asp:CheckBox ID="headerChkbox" runat="server"
AutoPostBack="True" />
</HeaderTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="ProductName" FilterControlAltText="Filter ProductName column" HeaderText="ProductName" SortExpression="ProductName" UniqueName="ProductName">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
</Columns>
this is my columns and i want to add product names which are checked to radlist yes you are right. but it doesnt work...where is my mistake?
thank you...
<telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server"
AutoPostBack="True" />
</ItemTemplate>
<HeaderTemplate>
<asp:CheckBox ID="headerChkbox" runat="server"
AutoPostBack="True" />
</HeaderTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="ProductName" FilterControlAltText="Filter ProductName column" HeaderText="ProductName" SortExpression="ProductName" UniqueName="ProductName">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
</Columns>
this is my columns and i want to add product names which are checked to radlist yes you are right. but it doesnt work...where is my mistake?
thank you...
0
Shinu
Top achievements
Rank 2
answered on 16 May 2013, 03:40 AM
Hi,
I guess your RadListBox is outside the Radgrid. Please check the following code snippet.
C#:
Thanks,
Shinu.
I guess your RadListBox is outside the Radgrid. Please check the following code snippet.
C#:
protected void CheckBox1_CheckedChanged(object sender, EventArgs e){ CheckBox chk = (CheckBox)sender; //accessing the CheckBox GridDataItem Data = (GridDataItem)chk.NamingContainer; //accessing the GridDataItem in which the checked checkbox resides string Value= Data["UniqueName"].Text; // getting value of the Bound column in the row RadListBoxItem item = new RadListBoxItem(Value, Value);// creating the ListBoxItem with BoundColumn's Text RadlistBox1.Items.Add(item); //adding the item in RadListBox}Thanks,
Shinu.
0
Hilmi
Top achievements
Rank 1
answered on 16 May 2013, 06:26 AM
Thanks, it is working..