I'm wondering how can I resolve this problem?
I've written this piece of code to select row items on My RadGrid Control, which has the following select parameters...
SelectCommand="SELECT CityPinnacleDeals.DealID, CityPinnacleDeals.UserID FROM CityPinnacleDeals WHERE (CityPinnacleDeals.DealCategory <> 13) ORDER BY CityPinnacleDeals.DealID DESC"
The statement is valid and selecting the appropriate data, the RadGrid has created all the selected columns
RadGrid DataKeyNames="UserID, DealID"
The Code for selecting the rows is contained in the Linkbutton or Imagebutton Click event (both buttons are components of Template Columns added to the RadGrid Control) and is written thus...
Image Button
Protected Sub SelectGadgetFilterTwo_Click(ByVal sender As Object, ByVal e As System.EventArgs)
CType(CType(sender, ImageButton).Parent.Parent, GridItem).Selected = CType(sender, ImageButton).Visible
RadGridFilterTwo_SelectedIndexChanged(sender, e)
End Sub
Link Button
Protected Sub SelectGadgetFilterTwo_Click(ByVal sender As Object, ByVal e As System.EventArgs)
CType(CType(sender, LinkButton).Parent.Parent, GridItem).Selected = CType(sender, LinkButton).Visible
RadGridFilterTwo_SelectedIndexChanged(sender, e)
End Sub
The ImageButton contains images, while the Linkbutton contains the names of the displayed images, when either of the buttons is clicked, users are expected to be redirected to another page with the following code...,
Protected Sub RadGridFilterTwo_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGridFilterTwo.SelectedIndexChanged
Dim MyGadgetID As Integer = RadGridFilterTwo.SelectedItems(0).OwnerTableView.DataKeyValues(RadGridFilterTwo.SelectedItems(0).ItemIndex)("DealID")
Dim MyGadgetUserID As Integer = RadGridFilterTwo.SelectedItems(0).OwnerTableView.DataKeyValues(RadGridFilterTwo.SelectedItems(0).ItemIndex)("UserID")
Response.Redirect("GadgetsHome.aspx?.diresu=" & Str(StaffNumber.Text) & "&.diresulead=" & MyGadgetUserID & "&.dilead=" & MyGadgetID)
End Sub
but I keep receiving the error message...
Now I'm wondering how can I resolve this problem?
I've written this piece of code to select row items on My RadGrid Control, which has the following select parameters...
SelectCommand="SELECT CityPinnacleDeals.DealID, CityPinnacleDeals.UserID FROM CityPinnacleDeals WHERE (CityPinnacleDeals.DealCategory <> 13) ORDER BY CityPinnacleDeals.DealID DESC"
The statement is valid and selecting the appropriate data, the RadGrid has created all the selected columns
RadGrid DataKeyNames="UserID, DealID"
The Code for selecting the rows is contained in the Linkbutton or Imagebutton Click event (both buttons are components of Template Columns added to the RadGrid Control) and is written thus...
Image Button
Protected Sub SelectGadgetFilterTwo_Click(ByVal sender As Object, ByVal e As System.EventArgs)
CType(CType(sender, ImageButton).Parent.Parent, GridItem).Selected = CType(sender, ImageButton).Visible
RadGridFilterTwo_SelectedIndexChanged(sender, e)
End Sub
Link Button
Protected Sub SelectGadgetFilterTwo_Click(ByVal sender As Object, ByVal e As System.EventArgs)
CType(CType(sender, LinkButton).Parent.Parent, GridItem).Selected = CType(sender, LinkButton).Visible
RadGridFilterTwo_SelectedIndexChanged(sender, e)
End Sub
The ImageButton contains images, while the Linkbutton contains the names of the displayed images, when either of the buttons is clicked, users are expected to be redirected to another page with the following code...,
Protected Sub RadGridFilterTwo_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGridFilterTwo.SelectedIndexChanged
Dim MyGadgetID As Integer = RadGridFilterTwo.SelectedItems(0).OwnerTableView.DataKeyValues(RadGridFilterTwo.SelectedItems(0).ItemIndex)("DealID")
Dim MyGadgetUserID As Integer = RadGridFilterTwo.SelectedItems(0).OwnerTableView.DataKeyValues(RadGridFilterTwo.SelectedItems(0).ItemIndex)("UserID")
Response.Redirect("GadgetsHome.aspx?.diresu=" & Str(StaffNumber.Text) & "&.diresulead=" & MyGadgetUserID & "&.dilead=" & MyGadgetID)
End Sub
but I keep receiving the error message...
"UserID is neither a DataColumn nor a DataRelation for table DefaultView"
Now I'm wondering how can I resolve this problem?