<
telerik:RadGrid ID="RadGrid1" Width="100%" runat="server" CellPadding="0" AutoGenerateColumns="false" GridLines="Both" HorizontalAlign="NotSet" ClientSettings-AllowColumnsReorder="false" ClientSettings-ReorderColumnsOnClient="false"
AllowSorting="false" FilterItemStyle-HorizontalAlign="Center" FilterItemStyle-VerticalAlign="middle">
<clientsettings EnablePostBackOnRowClick="true">
<ClientEvents />
<Selecting AllowRowSelect="True" ></Selecting>
<Scrolling EnableVirtualScrollPaging="true" UseStaticHeaders="True" SaveScrollPosition="true" FrozenColumnsCount="1"/>
</clientsettings>
<mastertableview borderstyle="None" datakeynames="ClientID1">
</mastertableview>
</telerik:RadGrid>
Private Sub Test_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
Dim dt1 As DataTable = Dac.ExecuteDataTable("usp_rr_admin_pc_getClients", Nothing)
Dim objDT = dt1
If RadGrid1.Columns.Count > 0 Then
RadGrid1.Columns.Clear()
End If
objDT.Columns.Add(
"ClientNameAR1", GetType(String))
Dim ogridcolumn As GridBoundColumn
ogridcolumn =
New GridBoundColumn
ogridcolumn.Visible =
True
ogridcolumn.HeaderText = "ClientNameAR"
ogridcolumn.DataField = "ClientNameAR"
ogridcolumn.HeaderStyle.Width = "70"
ogridcolumn.ItemStyle.Width = "70"
ogridcolumn.ItemStyle.BorderColor = Drawing.Color.Black
RadGrid1.Columns.Add(ogridcolumn)
objDT.Columns.Add(
"ClientID1", GetType(String))
ogridcolumn =
New GridBoundColumn
ogridcolumn.HeaderText =
"ClientID"
ogridcolumn.DataField = "ClientID"
ogridcolumn.Visible = True
ogridcolumn.ItemStyle.BorderColor = Drawing.Color.Black
RadGrid1.Columns.Add(ogridcolumn)
Dim dt3 As DataTable = Dac.ExecuteDataTable("usp_rr_admin_pc_getCategories", Nothing)
For Each drRow As DataRow In dt3.Rows
Dim val As String = drRow.Item("CategoryAR").ToString
objDT.Columns.Add(val)
ogridcolumn =
New GridBoundColumn
ogridcolumn.Visible =
True
ogridcolumn.DataField = val
ogridcolumn.HeaderText = val
ogridcolumn.UniqueName = val
ogridcolumn.HeaderStyle.Width =
"70"
ogridcolumn.ItemStyle.Width =
"70"
ogridcolumn.ItemStyle.BorderColor = Drawing.Color.Black
RadGrid1.Columns.Add(ogridcolumn)
Dim val1 As String = drRow.Item("CategoryID").ToString
objDT.Columns.Add(val1)
ogridcolumn =
New GridBoundColumn
ogridcolumn.Visible =
True
ogridcolumn.DataField = val1
ogridcolumn.HeaderText = val1
ogridcolumn.UniqueName = val1
ogridcolumn.ItemStyle.BorderColor = Drawing.Color.Black
RadGrid1.Columns.Add(ogridcolumn)
Next
ogridcolumn =
Nothing
Dim dt2 As DataTable = Dac.ExecuteDataTable("usp_rr_admin_pc_getClients", Nothing)
For Each dr As DataRow In dt2.Rows
objDR = objDT.NewRow
objDR(
"ClientID1") = dr("ClientID")
objDR(
"ClientNameAR1") = dr("ClientNameAR")
objDT.Rows.Add(objDR)
Next
dt2.Dispose()
dt2 =
Nothing
RadGrid1.DataSource = objDT
RadGrid1.DataBind()
objDT.Dispose()
objDT =
Nothing
RadGrid1.MasterTableView.Dir = GridTableTextDirection.RTL
End Sub
nopCommTopic.Items.Clear()
RCBI =
New RadComboBoxItem()
RCBI.Text =
"Select a topic..." & ",0"
RCBI.Value = 0
RCBI.Selected =
True
nopCommTopic.Items.Add(RCBI)
For Each Nop_Topic_Data In Nop_Topic_Arry
RCBI =
New RadComboBoxItem()
RCBI.Text = Nop_Topic_Data.Name &
", " & Nop_Topic_Data.TopicID.ToString
RCBI.Value = Nop_Topic_Data.TopicID
nopCommTopic.Items.Add(RCBI)
Next
===============================================================================
The page contains a button for execution after the user selects an item from the above combo box. After the button is clicked, the code retrieves the selected value from the combo box and then continues processing. The problem is that the selected value test (see code immediately below) always gets a 0 for the selectedvalue no matter which item in the combo box is selected. It also does not matter how many different entries in the combo box that you select before pressing the processing button.
The .aspx page code for the combo is shown further below. It's pretty simple.
===============================================================================
button click event code:
' Verify that the user did select a topic to translate and save it if they did
Dim iTopic As Integer = 0
If Me.nopCommTopic.SelectedValue = 0 Then
Me.PageErrors.Text = "You must select a topic to translate from the list!"
Exit Sub
End If
iTopic = nopCommTopic.SelectedValue
===============================================================================
===============================================================================
related code from .aspx page:
<
telerik:RadComboBox ID="nopCommTopic" Skin="NeoClassic" EnableEmbeddedSkins="false" runat="server"></telerik:RadComboBox>
<br />
<br />
<asp:Button ID="TranslateTopic" runat="server" Text="Translate Selected Topic" />
===============================================================================
Can you help me figure out what is wrong?
Thanks in advance! I feel so stupid, but I cannot figure this out. I must be missing something really basic!
Lynn