dear
i need an example about Rad grid has inline edit and in same time has tow rows Drop Down (country, city)
i need to make in edit mode the fields country & city Drop Down to allow chose from them and all that inline edit and in same time this grid allow Sorting & paging & grouping & filtering
Regard
Ahmed Salem
i need an example about Rad grid has inline edit and in same time has tow rows Drop Down (country, city)
i need to make in edit mode the fields country & city Drop Down to allow chose from them and all that inline edit and in same time this grid allow Sorting & paging & grouping & filtering
Regard
Ahmed Salem
3 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 24 Sep 2012, 04:46 AM
Hi Ahmed,
You can try the following code to perform filtering, paging etc in RadGrid.
aspx:
Also check these demos for more about grouping and editing.
Thanks,
Shinu.
You can try the following code to perform filtering, paging etc in RadGrid.
aspx:
<
telerik:RadGrid
ID
=
"RadGrid1"
AutoGenerateEditColumn
=
"true"
AllowPaging
=
"true"
PageSize
=
"4"
runat
=
"server"
AutoGenerateColumns
=
"false"
DataSourceID
=
"SqlDataSource2"
AllowFilteringByColumn
=
"true"
AllowSorting
=
"true"
>
<
MasterTableView
EditMode
=
"InPlace"
>
<
GroupByExpressions
>
<
telerik:GridGroupByExpression
>
<
SelectFields
>
<
telerik:GridGroupByField
FieldName
=
"LastName"
/>
</
SelectFields
>
<
GroupByFields
>
<
telerik:GridGroupByField
FieldName
=
"LastName"
/>
</
GroupByFields
>
</
telerik:GridGroupByExpression
>
</
GroupByExpressions
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"LastName"
UniqueName
=
"LastName"
HeaderText
=
"LastName"
></
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
>
<
EditItemTemplate
>
<
telerik:RadComboBox
ID
=
"RadComboBox1"
runat
=
"server"
DataSourceID
=
"SqlDataSource2"
DataTextField
=
"Email"
DataValueField
=
"Email"
></
telerik:RadComboBox
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
Thanks,
Shinu.
0
Ahmed
Top achievements
Rank 1
answered on 24 Sep 2012, 09:47 AM
Dear
I have two combo Box in my Grid one of them is Country and when
I chose one country I need send it is ID for the next combo box (City) to
select this cities only in the second combo box and all that will be in edit mode
And this blue example has only one combo box and it is not in relation with another combo box
So I need help in that one grid has two fields combo box and one
of them in relation in another select value like country and it is city only
Regard
Ahmed Salem
0
Hi Ahmed,
To achieve the desired functionality concerning having related comboboxes you could try using the approaches described in the following resources as a start point:
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multiplecomboboxes/defaultcs.aspx
http://www.telerik.com/community/code-library/aspnet-ajax/grid/using-cascading-radcomboboxes-into-the-radgrid-insert-edit-form.aspx
Another approach could be to use the GridTemplateColumn and add ComboBoxes into its template. Then you can get reference to the ComboBoxes in the ItemCreated event and attach the SelectedIndexChanged event for the control. Now in the event handler, access the second dropdownlist control from the other GridTemplateColumn and populate it accordingly.
You can access the second dropdownlist control by accessing the editform (using NamingContainer property of dropdown) and then by using the FindControl() method.
Please give the suggestions try and let me know if you experience any problems. Looking forward for your reply.
Kind regards,
Radoslav
the Telerik team
To achieve the desired functionality concerning having related comboboxes you could try using the approaches described in the following resources as a start point:
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multiplecomboboxes/defaultcs.aspx
http://www.telerik.com/community/code-library/aspnet-ajax/grid/using-cascading-radcomboboxes-into-the-radgrid-insert-edit-form.aspx
Another approach could be to use the GridTemplateColumn and add ComboBoxes into its template. Then you can get reference to the ComboBoxes in the ItemCreated event and attach the SelectedIndexChanged event for the control. Now in the event handler, access the second dropdownlist control from the other GridTemplateColumn and populate it accordingly.
You can access the second dropdownlist control by accessing the editform (using NamingContainer property of dropdown) and then by using the FindControl() method.
Please give the suggestions try and let me know if you experience any problems. Looking forward for your reply.
Kind regards,
Radoslav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.