Hello Everyone!
I have a problem regarding the DropdownColumn of the grid.
I have a grid with an inline edit and add mode. I also have a Dropdowncolumn in my grid.
What i want is that when I a new item using inline adding of the grid, the Dropdownlist of the Dropdowncolumn should display Items that are not added in the grid.
In short, The Items that are in the grid (specifically in my dropdown column) should not be displayed in the DropDownList during Adding.
I have tried this link
http://www.telerik.com/help/aspnet-ajax/grdcustomizeconfiguregriddropdowncolumn.html
but If I change the datasource of the DropDownColumn, the grid data of my DropDownColumn will be replaced with the firts item in my dropdownlist during adding mode.
I have a problem regarding the DropdownColumn of the grid.
I have a grid with an inline edit and add mode. I also have a Dropdowncolumn in my grid.
What i want is that when I a new item using inline adding of the grid, the Dropdownlist of the Dropdowncolumn should display Items that are not added in the grid.
In short, The Items that are in the grid (specifically in my dropdown column) should not be displayed in the DropDownList during Adding.
I have tried this link
http://www.telerik.com/help/aspnet-ajax/grdcustomizeconfiguregriddropdowncolumn.html
but If I change the datasource of the DropDownColumn, the grid data of my DropDownColumn will be replaced with the firts item in my dropdownlist during adding mode.
6 Answers, 1 is accepted
0
Hello Erwin,
You could bind the GridDropDownColumn to the SqlDataSource and use a select query which get only distinct data from the database.
Please review the below article on how to bind GridDropDownColumn to SqlDataSource:
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/columntypes/defaultcs.aspx
The other option is on RadGrid.ItemDataBound event to check if the grid is in insert mode and you could try to remove all Items from the dropdown list which already have been added to the grid accordingly.
I hope this helps.
All the best,
Radoslav
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
You could bind the GridDropDownColumn to the SqlDataSource and use a select query which get only distinct data from the database.
Please review the below article on how to bind GridDropDownColumn to SqlDataSource:
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/columntypes/defaultcs.aspx
The other option is on RadGrid.ItemDataBound event to check if the grid is in insert mode and you could try to remove all Items from the dropdown list which already have been added to the grid accordingly.
I hope this helps.
All the best,
Radoslav
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0

Nathan
Top achievements
Rank 1
answered on 05 Feb 2010, 02:35 PM
Radoslav,
Not to Hijack Erwins post but what triggers the ItemDataBound? I have a dropdown menu and even if I am in editmode the itemdatabound is not being triggered.
Not to Hijack Erwins post but what triggers the ItemDataBound? I have a dropdown menu and even if I am in editmode the itemdatabound is not being triggered.
0
Hi Nathan,
The ItemDataBound event is fired only when the grid binds to data. It is fired just after ItemCreated event. So you could create the controls in the ItemCreated event handler and bind them to data in the ItemDataBound (if that's needed).
More information about the ItemDataBound event you could find in the following online documentation article:
http://www.telerik.com/help/aspnet-ajax/telerik.web.ui-telerik.web.ui.radgrid-itemdatabound_ev.html
Additionally could you please send us a simple runnable application demonstrating the described issue. You could open a formal support ticket from your Telerik account and attach a ZIP file there. I will inspect the code and advise you further.
I hope this helps
Sincerely yours,
Radoslav
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
The ItemDataBound event is fired only when the grid binds to data. It is fired just after ItemCreated event. So you could create the controls in the ItemCreated event handler and bind them to data in the ItemDataBound (if that's needed).
More information about the ItemDataBound event you could find in the following online documentation article:
http://www.telerik.com/help/aspnet-ajax/telerik.web.ui-telerik.web.ui.radgrid-itemdatabound_ev.html
Additionally could you please send us a simple runnable application demonstrating the described issue. You could open a formal support ticket from your Telerik account and attach a ZIP file there. I will inspect the code and advise you further.
I hope this helps
Sincerely yours,
Radoslav
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0

Erwin
Top achievements
Rank 1
answered on 15 Feb 2010, 11:17 AM
I follow some people's advice and solved the problem
I made my Dropdowncolumn to a template column with
Itemtemplate
Label: with a value using DataBinder(datafield) from the datasource of the grid
EditItem
Combobox: with the value of the items to be shown
filtered not to have items that are not in the grid.
and my problem was solved...
thanks for the replay
I made my Dropdowncolumn to a template column with
Itemtemplate
Label: with a value using DataBinder(datafield) from the datasource of the grid
EditItem
Combobox: with the value of the items to be shown
filtered not to have items that are not in the grid.
and my problem was solved...
thanks for the replay
0

Sreekanth
Top achievements
Rank 1
answered on 16 Jan 2012, 01:56 PM
Hi,
I am currently working on the GridDrodown column where am unable to bind the data to the GridDrodown coulmn.
I dont want to use Template coulmn,can you please provide me a sample working project.
I have tried the below links,but these were not helpfull.
http://www.telerik.com/help/aspnet/grid/grdcustomizeconfiguregriddropdowncolumn.html
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/columntypes/defaultcs.aspx
Regards,
Sreekanth
I am currently working on the GridDrodown column where am unable to bind the data to the GridDrodown coulmn.
I dont want to use Template coulmn,can you please provide me a sample working project.
I have tried the below links,but these were not helpfull.
http://www.telerik.com/help/aspnet/grid/grdcustomizeconfiguregriddropdowncolumn.html
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/columntypes/defaultcs.aspx
Regards,
Sreekanth
0

Shinu
Top achievements
Rank 2
answered on 17 Jan 2012, 06:34 AM
Hello Sreekanth,
Try the following code.
C#:
-Shinu.
Try the following code.
C#:
protected
void
grid_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridEditableItem && e.Item.IsInEditMode)
{
GridEditableItem item = (GridEditableItem)e.Item;
DropDownList ddl = (DropDownList)item[
"UniqueName"
].Controls[0];
ddl.DataSourceID =
"SqlDataSource1"
;
ddl.DataTextField =
"Id"
;
ddl.DataValueField =
"Id"
;
}
}
-Shinu.