Hello All,
I am working on a RadGrid to pull data from the database, then added a select button to popup a RadWindow to show more details of that file, it works OK. But when I filter the grid, then click on the select button it will display the wrong data for a different row like it wasn't filtered here is the aspx:
<rad:radwindowmanager id="RadWindowManager1" runat="server" MinimizeZoneId="HorizontalMinimize" DestroyOnClose="True" Behavior="Maximize, Close, resize" Left="" NavigateUrl="" SkinsPath="~/RadControls/Window/Skins" Title="" Top="" Modal="True" Width="600px" Height="400px"> |
<Windows> |
<rad:RadWindow ID="RadWindow1" runat="server" Left="" NavigateUrl="RadPhys.aspx" SkinsPath="~/RadControls/Window/Skins" |
Title="Physician Information" Top="" /> |
</Windows> |
</rad:radwindowmanager> |
<radg:radgrid id="rgPhysician" runat="server" AutoGenerateColumns="False" GridLines="None" |
AllowFilteringByColumn="true" Skin="WebBlue" > |
<MasterTableView DataKeyNames="PhysID"> |
<Columns> |
<radG:GridTemplateColumn UniqueName="TemplateColumn"> |
<ItemTemplate> |
<asp:LinkButton ID="btnViewPhysician" runat="server" CommandName="Select" Text="Select">Select</asp:LinkButton> |
</ItemTemplate> |
</radG:GridTemplateColumn> |
<radG:GridBoundColumn DataField="PhysID" Display="False" HeaderText="PhysID" |
ReadOnly="True" UniqueName="PhysID"> |
</radG:GridBoundColumn> |
<radG:GridBoundColumn DataField="ContactType" Display="False" HeaderText="ContactType" |
ReadOnly="True" UniqueName="ContactType"> |
</radG:GridBoundColumn> |
<radG:GridBoundColumn DataField="PhysFullName" HeaderText="Name" UniqueName="PhysFullName"> |
</radG:GridBoundColumn> |
<radG:GridBoundColumn DataField="PhysSpeciality" HeaderText="Speciality" UniqueName="PhysSpeciality"> |
</radG:GridBoundColumn> |
<radG:GridBoundColumn DataField="Office" HeaderText="Office" UniqueName="Office"> |
</radG:GridBoundColumn> |
</Columns> |
<RowIndicatorColumn Visible="False"> |
<HeaderStyle Width="20px" /> |
</RowIndicatorColumn> |
<ExpandCollapseColumn Visible="False"> |
<HeaderStyle Width="19px" /> |
</ExpandCollapseColumn> |
</MasterTableView> |
</radg:radgrid><br /> |
<radA:RadAjaxManager ID="RadAjaxManager1" runat="server" EnablePageHeadUpdate="False"> |
<AjaxSettings> |
<radA:AjaxSetting AjaxControlID="RadWindowManager1"> |
<UpdatedControls> |
<radA:AjaxUpdatedControl ControlID="RadWindowManager1" /> |
</UpdatedControls> |
</radA:AjaxSetting> |
</AjaxSettings> |
</radA:RadAjaxManager> |
Here is the VB.NET
Imports Telerik.Web.UI |
Imports System.Collections |
Imports System.Data.SqlClient |
Imports System.Web.UI |
Imports System.Web.UI.WebControls |
Imports System.Web.UI.WebControls.WebParts |
Imports System.Web.UI.HtmlControls |
Imports System.Security.Principal |
Imports AjaxControlToolkit |
Partial Class PhysList |
Inherits System.Web.UI.UserControl |
Public dataConn As New PhoneBookDLL.dl |
Protected Sub rgPhysician_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles rgPhysician.Init |
Dim menu As GridFilterMenu = rgPhysician.FilterMenu |
Dim i As Integer = 0 |
While i < menu.Items.Count |
If menu.Items(i).Text = "NoFilter" Or menu.Items(i).Text = "Contains" Or menu.Items(i).Text = "EqualTo" Or menu.Items(i).Text = "StartsWith" Or _ |
menu.Items(i).Text = "EndsWith" Then |
i = i + 1 |
Else |
menu.Items.RemoveAt(i) |
End If |
End While |
End Sub |
Protected Sub rgPhysician_NeedDataSource(ByVal source As Object, ByVal e As Telerik.WebControls.GridNeedDataSourceEventArgs) Handles rgPhysician.NeedDataSource |
Dim getDS As New DataSet |
getDS = dataConn.PhoneActivePhys() |
rgPhysician.DataSource = getDS.Tables(0).DefaultView |
End Sub |
Public Sub ViewPhysicianInfo(ByVal sender As Object, ByVal e As System.EventArgs) Handles rgPhysician.SelectedIndexChanged |
Dim x As String = rgPhysician.MasterTableView.Items(rgPhysician.SelectedIndexes(0)).Item("PhysID").Text |
Dim PhysID As String = rgPhysician.SelectedValue.ToString |
'Dim PhysID As String = rgPhysician.SelectedIndexes.Item(0).ToString |
'Dim PhysID As String = rgPhysician.SelectedItems.Item("PhysID").ToString |
RadWindowManager1.VisibleOnPageLoad = True |
RadWindow1.NavigateUrl = "RadPhys.aspx?ID=" & PhysID |
End Sub |
'Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load |
' If Not IsPostBack Then |
' Dim getDS As New DataSet |
' getDS = dataConn.PhoneActivePhys() |
' rgPhysician.DataSource = getDS.Tables(0).DefaultView |
' rgPhysician.DataBind() |
' End If |
'End Sub |
End Class |
Thanks for all your help,
Sheheb