Hi,
I'm trying to implement selection list for lookup tables in the Radgrid popup edit/insert form.
I'd like to use Radcomboboxes with Radgrid as Item Template as described here: http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridincombobox/defaultvb.aspx?product=grid
My scenario is a little bit different, because the RadComboBox i want to populate with the selection is in the edit form, and I don't know how to access this control. FindControl("RadComboboxName") returns "Nothing".
Thanks in advance.
D
I'm trying to implement selection list for lookup tables in the Radgrid popup edit/insert form.
I'd like to use Radcomboboxes with Radgrid as Item Template as described here: http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridincombobox/defaultvb.aspx?product=grid
My scenario is a little bit different, because the RadComboBox i want to populate with the selection is in the edit form, and I don't know how to access this control. FindControl("RadComboboxName") returns "Nothing".
Thanks in advance.
D
6 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 09 May 2011, 02:27 PM
Hello Daniele,
Here is a sample code to achieve your scenario.
aspx:
C#:
Thanks,
Princy.
Here is a sample code to achieve your scenario.
aspx:
<
telerik:GridTemplateColumn
HeaderText
=
"TextBoxcol"
UniqueName
=
"ComBo"
>
<
ItemTemplate
>
. . . . . . . . . . . . .
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadComboBox
ID
=
"RadCombo1"
runat
=
"server"
Width
=
"200px"
EmptyMessage
=
"Select An Item"
DataTextField
=
"FirstName"
>
</
telerik:RadComboBox
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
C#:
protected
void
RadGrid1_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridEditFormItem && e.Item.IsInEditMode)
//Edit mode is EditForm/PopUp
{
GridEditFormItem item = (GridEditFormItem)e.Item;
RadComboBox combo = (RadComboBox)item.FindControl(
"RadCombo1"
);
}
}
Thanks,
Princy.
0

daniele
Top achievements
Rank 1
answered on 10 May 2011, 11:02 AM
Now I've got another issue.
Now I've got the Radgrid in the RadCombobox, and I'm able to populate it clicking on the desired row of the grid.
Evertything seems to work fine, except from the grid pager. When I navigate the grid pages RadComboBox get closed by itself.
How can I keep it opened?
Thanks in advance.
Now I've got the Radgrid in the RadCombobox, and I'm able to populate it clicking on the desired row of the grid.
Evertything seems to work fine, except from the grid pager. When I navigate the grid pages RadComboBox get closed by itself.
How can I keep it opened?
Thanks in advance.
0

Princy
Top achievements
Rank 2
answered on 10 May 2011, 11:57 AM
Hello Daniele,
You could try the approach in the code library.
How to keep the combobox open while handling interior clicks
Hope it helps.
Thanks,
Princy.
You could try the approach in the code library.
How to keep the combobox open while handling interior clicks
Hope it helps.
Thanks,
Princy.
0

daniele
Top achievements
Rank 1
answered on 10 May 2011, 02:43 PM
I can't still achieve what I meant to do.
Your suggestion works fine only when I mouse click on the RadGrid rows (and I want dropdown to close after this event).
When I click over the pager or the filter element the RadComboBox gets closed, as if I had clicked outside its area.
I've tried also to cancel the bubbling for the event, as suggested here http://www.telerik.com/community/forums/aspnet-ajax/combobox/radgrid-in-radcombobox-disappears-after-paging-event.aspx, but I have the same behavior.
Clicks on pager and filter seem to be "uncatchable" as if they did not belong to RadGrid.
Is there another way to avoid radcombobox dropdown closing, so that I can use paging and filtering in RadGrid?
Thanks.
Daniele
Your suggestion works fine only when I mouse click on the RadGrid rows (and I want dropdown to close after this event).
When I click over the pager or the filter element the RadComboBox gets closed, as if I had clicked outside its area.
I've tried also to cancel the bubbling for the event, as suggested here http://www.telerik.com/community/forums/aspnet-ajax/combobox/radgrid-in-radcombobox-disappears-after-paging-event.aspx, but I have the same behavior.
Clicks on pager and filter seem to be "uncatchable" as if they did not belong to RadGrid.
Is there another way to avoid radcombobox dropdown closing, so that I can use paging and filtering in RadGrid?
Thanks.
Daniele
0

Princy
Top achievements
Rank 2
answered on 11 May 2011, 07:54 AM
Hello Daniele,
Hello ,
I have tried the same and faced the same issue.When the pageIndex changed, the post back happens and the Dopdown get closed. One suggestion is to ajaxify the Grid to resolve the problem. Here is the that aspx that I tried.
Also check the following help documentation for more on AJAX controls.
Overview.
Thanks,
Princy.
Hello ,
I have tried the same and faced the same issue.When the pageIndex changed, the post back happens and the Dopdown get closed. One suggestion is to ajaxify the Grid to resolve the problem. Here is the that aspx that I tried.
<
div
>
<
telerik:RadComboBox
ID
=
"RadCombo"
runat
=
"server"
AutoPostBack
=
"true"
>
<
ItemTemplate
>
<
telerik:RadAjaxPanel
runat
=
"server"
ID
=
"ajax"
>
<
telerik:RadGrid
runat
=
"server"
ID
=
"RadGrid1"
>
. . . .
</
telerik:RadGrid
>
</
telerik:RadAjaxPanel
>
</
ItemTemplate
>
</
telerik:RadComboBox
>
</
div
>
Also check the following help documentation for more on AJAX controls.
Overview.
Thanks,
Princy.
0

daniele
Top achievements
Rank 1
answered on 11 May 2011, 09:56 AM
I had already tried this solution, but it does not work.
Clicking over the pager and filter still forces the dropdown to close.
It's a quite important feature for the application we are developing to have simple lookup grid. My coussin made me see a project realized with DevX controls and it's amazing how simple the lookup grid implementation is. It can be all done by designer without having to write a single line of code.
Is it impossible with Telerik controls at all?
We'd like to avoid realizing customized controls, by using the ones included in the suite.
Thanks.
D
Clicking over the pager and filter still forces the dropdown to close.
It's a quite important feature for the application we are developing to have simple lookup grid. My coussin made me see a project realized with DevX controls and it's amazing how simple the lookup grid implementation is. It can be all done by designer without having to write a single line of code.
Is it impossible with Telerik controls at all?
We'd like to avoid realizing customized controls, by using the ones included in the suite.
Thanks.
D