hi,
I have two combo box
the first one has auto post back true so when selected index changed it fills the second combo box
<table>
<tr>
<td>
<asp:Label ID="lblDevGroups" runat="server" Text="Groups"></asp:Label></td>
<td>
<telerik:RadComboBox ID="ddlDevGroups" runat="server" Width="200px" MarkFirstMatch="true" AutoPostBack="true" />
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblDevices" runat="server" Text="Devices" Visible="False"></asp:Label></td>
<td>
<telerik:RadComboBox ID="ddlDevices" runat="server" Width="200px" MarkFirstMatch="true" AutoPostBack="false" Visible="false">
<ItemTemplate>
<table style="border-bottom: 1px dotted #EFEFEF; margin-bottom: 10px; font-size: 11px;" width="98%">
<tr>
<td>
<img src='<%# DataBinder.Eval(Container, "Normal_IconPath")%>' alt="" />
</td>
<td>
<%#DataBinder.Eval(Container, "Serial_No")%>
(<%#DataBinder.Eval(Container, "Device_Name")%>)
</td>
</tr>
</table>
</ItemTemplate>
</telerik:RadComboBox>
</td>
<td>
<asp:Button ID="btnEditDevices" runat="server" Text="Edit" Visible="False" /></td>
</tr>
</table>
the ddlDevGroubs (the first combo box) selected index changed event is:
ddlDevices.Items.Clear()
Dim strGroupID As String = ddlDevGroups.SelectedValue
If Not strGroupID = "" Then
Dim strSQLDevices As String = "Select ds.ID, ds.Device_ID, ds.Device_Name, ds.Serial_No, ds.Icon, dc.Normal_IconPath from CTS_DeviceSettings ds inner join dbo.CTS_DeviceIcons dc on ds.Icon = dc.id where ds.group_ID=" & strGroupID
Dim dsDevices As DataSet = clsDB.getData(strSQLDevices)
If Not dsDevices Is Nothing Then
If dsDevices.Tables(0).Rows.Count > 0 Then
Dim dtDevices As DataTable = dsDevices.Tables(0)
'dtDevices.Columns.Add("DevIDName")
'Dim i As Integer = 0
'For i = 0 To dtDevices.Rows.Count - 1
' Dim strDevName As String
' If IsDBNull(dtDevices.Rows(i)("Device_Name")) Then
' strDevName = ""
' Else
' strDevName = dtDevices.Rows(i)("Device_Name")
' End If
' Dim strDevID As String = dtDevices.Rows(i)("Device_ID")
' Dim strDevSerialNo As String = ""
' If Not IsDBNull(dtDevices.Rows(i)("Serial_No")) Then
' strDevSerialNo = dtDevices.Rows(i)("Serial_No")
' Else
' strDevSerialNo = ""
' End If
' If Not strDevName = "" Then
' dtDevices.Rows(i)("DevIDName") = strDevSerialNo & " (" & strDevName & ")"
' Else
' dtDevices.Rows(i)("DevIDName") = strDevSerialNo
' End If
'Next
For Each row As DataRow In dtDevices.Rows
row("Normal_IconPath") = Page.ResolveClientUrl(row("Normal_IconPath").ToString())
Next
ddlDevices.DataSource = dtDevices
'ddlDevices.DataTextField = "DevIDName"
'ddlDevices.DataValueField = "ID"
ddlDevices.DataBind()
lblMessage.Visible = False
lblDevices.Visible = True
ddlDevices.Visible = True
ddlDevices.Visible = True
btnEditDevices.Visible = True
btnEditDevices.Visible = True
lblDevices.Visible = True
Else
'No Device Records
lblMessage.Text = "No Devices have been Found"
lblMessage.Visible = True
pnlInfo.Visible = False
ddlDevices.Visible = False
btnEditDevices.Visible = False
lblDevices.Visible = False
clsLog.WriteNoRecords("/Members/Devices/Configuration.aspx", strSQLDevices)
End If
Else
'error Devices
lblMessage.Text = "Error While retriving Devices information"
lblMessage.Visible = True
clsLog.WriteSQLError("/Members/Devices/Configuration.aspx", strSQLDevices)
End If
Else
lblMessage.Text = "Please select a group"
lblMessage.Visible = True
ddlDevices.Visible = False
btnEditDevices.Visible = False
lblDevices.Visible = False
End If
now after all I got this error:
Exception Details: System.Web.HttpException: DataBinding: 'Telerik.Web.UI.RadComboBoxItem' does not contain a property with the name 'Normal_IconPath'.
Source Error:
so any help please?
I have two combo box
the first one has auto post back true so when selected index changed it fills the second combo box
<table>
<tr>
<td>
<asp:Label ID="lblDevGroups" runat="server" Text="Groups"></asp:Label></td>
<td>
<telerik:RadComboBox ID="ddlDevGroups" runat="server" Width="200px" MarkFirstMatch="true" AutoPostBack="true" />
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblDevices" runat="server" Text="Devices" Visible="False"></asp:Label></td>
<td>
<telerik:RadComboBox ID="ddlDevices" runat="server" Width="200px" MarkFirstMatch="true" AutoPostBack="false" Visible="false">
<ItemTemplate>
<table style="border-bottom: 1px dotted #EFEFEF; margin-bottom: 10px; font-size: 11px;" width="98%">
<tr>
<td>
<img src='<%# DataBinder.Eval(Container, "Normal_IconPath")%>' alt="" />
</td>
<td>
<%#DataBinder.Eval(Container, "Serial_No")%>
(<%#DataBinder.Eval(Container, "Device_Name")%>)
</td>
</tr>
</table>
</ItemTemplate>
</telerik:RadComboBox>
</td>
<td>
<asp:Button ID="btnEditDevices" runat="server" Text="Edit" Visible="False" /></td>
</tr>
</table>
the ddlDevGroubs (the first combo box) selected index changed event is:
ddlDevices.Items.Clear()
Dim strGroupID As String = ddlDevGroups.SelectedValue
If Not strGroupID = "" Then
Dim strSQLDevices As String = "Select ds.ID, ds.Device_ID, ds.Device_Name, ds.Serial_No, ds.Icon, dc.Normal_IconPath from CTS_DeviceSettings ds inner join dbo.CTS_DeviceIcons dc on ds.Icon = dc.id where ds.group_ID=" & strGroupID
Dim dsDevices As DataSet = clsDB.getData(strSQLDevices)
If Not dsDevices Is Nothing Then
If dsDevices.Tables(0).Rows.Count > 0 Then
Dim dtDevices As DataTable = dsDevices.Tables(0)
'dtDevices.Columns.Add("DevIDName")
'Dim i As Integer = 0
'For i = 0 To dtDevices.Rows.Count - 1
' Dim strDevName As String
' If IsDBNull(dtDevices.Rows(i)("Device_Name")) Then
' strDevName = ""
' Else
' strDevName = dtDevices.Rows(i)("Device_Name")
' End If
' Dim strDevID As String = dtDevices.Rows(i)("Device_ID")
' Dim strDevSerialNo As String = ""
' If Not IsDBNull(dtDevices.Rows(i)("Serial_No")) Then
' strDevSerialNo = dtDevices.Rows(i)("Serial_No")
' Else
' strDevSerialNo = ""
' End If
' If Not strDevName = "" Then
' dtDevices.Rows(i)("DevIDName") = strDevSerialNo & " (" & strDevName & ")"
' Else
' dtDevices.Rows(i)("DevIDName") = strDevSerialNo
' End If
'Next
For Each row As DataRow In dtDevices.Rows
row("Normal_IconPath") = Page.ResolveClientUrl(row("Normal_IconPath").ToString())
Next
ddlDevices.DataSource = dtDevices
'ddlDevices.DataTextField = "DevIDName"
'ddlDevices.DataValueField = "ID"
ddlDevices.DataBind()
lblMessage.Visible = False
lblDevices.Visible = True
ddlDevices.Visible = True
ddlDevices.Visible = True
btnEditDevices.Visible = True
btnEditDevices.Visible = True
lblDevices.Visible = True
Else
'No Device Records
lblMessage.Text = "No Devices have been Found"
lblMessage.Visible = True
pnlInfo.Visible = False
ddlDevices.Visible = False
btnEditDevices.Visible = False
lblDevices.Visible = False
clsLog.WriteNoRecords("/Members/Devices/Configuration.aspx", strSQLDevices)
End If
Else
'error Devices
lblMessage.Text = "Error While retriving Devices information"
lblMessage.Visible = True
clsLog.WriteSQLError("/Members/Devices/Configuration.aspx", strSQLDevices)
End If
Else
lblMessage.Text = "Please select a group"
lblMessage.Visible = True
ddlDevices.Visible = False
btnEditDevices.Visible = False
lblDevices.Visible = False
End If
now after all I got this error:
DataBinding: 'Telerik.Web.UI.RadComboBoxItem' does not contain a property with the name 'Normal_IconPath'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Web.HttpException: DataBinding: 'Telerik.Web.UI.RadComboBoxItem' does not contain a property with the name 'Normal_IconPath'.
Source Error:
Line 90: <tr>
Line 91: <td>
Line 92: <img src='<%# DataBinder.Eval(Container, "Normal_IconPath")%>' alt="" />
Line 93: </td>
Line 94: <td><%#DataBinder.Eval(Container, "Serial_No")%>
|
so any help please?