Hey,
I am reusing the exact example in the following telerik demo RadGrid with UC.
The one and only change I made is that I reload my Combobox from a database. Everything works fine when Editing an existing row, but when I hit the "Add new Record", the RadComboBox gets the same values twice. I tracked this in the debug mode, and the RadComboBox shows the correct items count, but when rendered in the page, it is X2.
here is the only code I changed from the above example, I am using 2010 Q3.
What is wrong with my code?
Thanks in advance!
-Mahmoud
I am reusing the exact example in the following telerik demo RadGrid with UC.
The one and only change I made is that I reload my Combobox from a database. Everything works fine when Editing an existing row, but when I hit the "Add new Record", the RadComboBox gets the same values twice. I tracked this in the debug mode, and the RadComboBox shows the correct items count, but when rendered in the page, it is X2.
here is the only code I changed from the above example, I am using 2010 Q3.
Private
Sub
Page_DataBinding(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
Me
.DataBinding
Me
.CmDealer.Items.Clear()
Me
.CmDealer.AppendDataBoundItems =
True
Me
.CmDealer.Items.Add(
New
ListItem(
""
,
"0"
))
Me
.CmDealer.DataValueField =
"ID"
Me
.CmDealer.DataTextField =
"Name"
Me
.CmDealer.DataSource = DataManager.GetDealers()
Me
.CmDealer.DataBind()
Dim
dealer
As
Object
= DataBinder.Eval(DataItem,
"IDDEALER"
)
If
dealer.Equals(DBNull.Value)
Then
CmDealer.SelectedValue = 0
Return
End
If
CmDealer.SelectedValue =
CInt
(dealer)
CmDealer.DataSource =
Nothing
''''''''''''''''''''''
Me
.CmManager.Items.Clear()
Me
.CmManager.AppendDataBoundItems =
True
Me
.CmManager.Items.Add(
New
ListItem(
""
,
"0"
))
Me
.CmManager.DataValueField =
"ID"
Me
.CmManager.DataTextField =
"Name"
Me
.CmManager.DataSource = DataManager.GetManagers()
Me
.CmManager.DataBind()
Dim
manager
As
Object
= DataBinder.Eval(DataItem,
"IDMANAGER"
)
If
manager.Equals(DBNull.Value)
Then
CmManager.SelectedValue = 0
Return
End
If
CmManager.SelectedValue =
CInt
(manager)
CmManager.DataSource =
Nothing
End
Sub
What is wrong with my code?
Thanks in advance!
-Mahmoud