Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
139 views

Hi All,

I have very little experiance with radgrid controls. I want to use google-like filtering in my grid.

1) I using unbound custom binding using DataTable.

Please find my code below . Please help me.

Thanks and Regards,
Pravat Sharma

-------------------

<%

@ Page Language="VB" MasterPageFile="~/KMStoreMasterPageV1.master" AutoEventWireup="false" EnableViewState="true"

 

 

 

CodeFile

 

 

="CampaignHeader.aspx.vb" Inherits="CampaignHeader" title="Campaign List" %>

 

<%

 

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

<%

 

@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="radG" %>

 

<%

 

@ Register Assembly="RadComboBox.Net2" Namespace="Telerik.WebControls" TagPrefix="radC" %>

 

 

<%

 

@ Register Src="Parts/KMFlashTitle.ascx" TagName="KMFlashTitle" TagPrefix="uc1" %>

 

<%

 

@ Register TagPrefix="custom" Namespace="Telerik.GridExamplesVBNET.Programming.FilteringTemplateColumns" %>

 

<%

 

@ Register TagPrefix="igtab" Namespace="Infragistics.WebUI.UltraWebTab" Assembly="Infragistics2.WebUI.UltraWebTab.v6.3, Version=6.3.20063.53, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" %>

 

<%

 

@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

 

<%

 

@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

 

 

 

 

 

 

 

Namespace="System.Web.UI" TagPrefix="asp" %>

 

<%

 

@ Register Assembly="AjaxControls" Namespace="AjaxControls" TagPrefix="uc2" %>

 

<%

 

@ Register Src="Parts/FlexButton2.ascx" TagName="FlexButton2" TagPrefix="uc3" %>

 

<%

 

@ Register Src="Parts/FlexButton.ascx" TagName="FlexButton" TagPrefix="uc2" %>

 

<%

 

@ Register Src="Parts/FlexButton.ascx" TagName="FlexButton" TagPrefix="ucFB" %>

 

<%

 

@ Register Assembly="KMControlLibrary" Namespace="KMControlLibrary" TagPrefix="kmcl" %>

 

<%

 

@ MasterType virtualpath="~/KMStoreMasterPageV1.master" %>

 

<%

 

@ Register Src="Parts/CampaignHoverMenuExtender.ascx" TagName="CampaignHover" TagPrefix="ch" %>

 

 

 

 

 

<

 

 

asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

 

<

 

 

asp:ScriptManagerProxy id="ScriptManagerProxy1" runat="server">

 

</

 

 

asp:ScriptManagerProxy>

 

<

 

 

asp:Label ID="lblPageTitle" runat="server" Font-Bold="true" Font-Size="15px" ForeColor="#ff66ff"></asp:Label>

 

<

 

 

uc1:KMFlashTitle ID="KMFlashTitle1" runat="server" FlashHeight="48" FlashWidth="594" FlashFile="title_2.swf" />

 

<

 

 

div class="vspace15"></div>

 

<

 

 

div class="vspace15"></div>

 

 

<

 

 

asp:UpdatePanel ID="updPanel" runat="server" UpdateMode="Conditional">

 

 

 

 

<

 

 

ContentTemplate>

 

 

 

 

 

 

 

<radG:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" AllowPaging="True"

 

 

 

 

 

 

 

AllowSorting="True" AllowFilteringByColumn="True" EnableAJAX="True"

 

 

 

EnableAJAXLoadingTemplate="True" Skin="Windows">

 

 

 

 

 

 

 

 

<MasterTableView AllowSorting="true" AutoGenerateColumns="false" >

 

 

 

<Columns>

 

 

 

 

 

 

 

 

<radG:GridTemplateColumn Visible="false">

 

 

 

 

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="ContentID" runat="server" Text='<% # DataBinder.Eval(Container.DataItem, "ContentID") %>'></asp:Label>

 

 

 

</ItemTemplate>

 

 

 

 

 

 

 

</radG:GridTemplateColumn>

 

 

 

 

 

 

 

 

<radG:GridTemplateColumn HeaderText="Published Date" DataField="PublishedDate" HeaderStyle-Width="100px" AutoPostBackOnFilter="true" SortExpression="PublishedDate">

 

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

 

<asp:Label ID="PublishedDate" runat="server" Text='<% #Convert.ToDateTime(DataBinder.Eval(Container.DataItem, "PublishedDate")).ToString("MM/dd/yyyy")%>'></asp:Label>

 

 

 

</ItemTemplate>

 

 

 

 

 

 

 

</radG:GridTemplateColumn>

 

 

 

 

 

 

 

 

<radG:GridTemplateColumn HeaderText="Title" DataField="Title" SortExpression="Title" >

 

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

 

 

<asp:Label ID="Title" runat="server" Text='<% #DataBinder.Eval(Container.DataItem, "Title")%>'></asp:Label>

 

 

 

 

 

 

 

 

<telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="Title"

 

 

 

RelativeTo="Element" Position="MiddleRight">

 

 

 

 

 

 

 

 

<table border="1" cellpadding="0" cellspacing="0" width="450px">

 

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

<td >

 

 

 

<asp:label id="lblProductTitle" runat="server" CssClass="labelText" ForeColor="#15c4ed">Campaings</asp:label>

 

 

 

 

 

 

 

</td>

 

 

 

 

 

 

 

<td >

 

 

 

<asp:label id="lblProductDescriptionTitle" runat="server" ForeColor="#15c4ed" Text='<%# Eval("Title") %>'></asp:label>

 

 

 

 

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

 

 

 

 

<td >

 

 

 

<asp:label id="lblHoverProductID" runat="server" CssClass="labelText" ForeColor="#15c4ed">ProductID</asp:label>

 

 

 

 

 

 

 

</td>

 

 

 

<td >

 

 

 

<asp:label id="lblProductID" runat="server" CssClass="labelText" ForeColor="#15c4ed" Text='<%# Eval("UserID") %>'></asp:label>

 

 

 

 

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

 

 

 

 

<td >

 

 

 

<asp:label id="lblHoverDescriptionTitle" runat="server" CssClass="labelText" ForeColor="#15c4ed">Overview</asp:label>

 

 

 

 

 

 

 

</td>

 

 

 

<td align="left" valign="top">

 

 

 

<asp:Label id="lblHoverDescription" runat="server" CssClass="labelText" ForeColor="black" Text='<%# Eval("Description") %>'></asp:Label>

 

 

 

 

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td valign="top" >

 

 

 

<asp:label id="lblHoverPublishedDateTitle" runat="server" CssClass="labelText" ForeColor="#15c4ed">Published Date</asp:label>

 

 

 

 

 

 

 

</td>

 

 

 

<td align="left" valign="top">

 

 

 

<asp:Label ID="lblHoverPublishedDate" runat="server" CssClass="labelText" ForeColor="black" Text='<%#Eval("PublishedDate", "{0:MM/yyyy}")%>'></asp:Label>

 

 

 

 

 

 

 

</td>

 

 

 

</tr>

 

 

 

 

<td align="left" valign="top">

 

 

 

 

 

 

 

<table border="0" cellpadding="0" cellspacing="0">

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

<td id="item_preview" align="right" valign="top">

 

 

 

 

 

 

 

<img src='<%# BuildImageURL( Eval("Thumbnail") ) %>' alt="" width="125" height="100" />

 

 

 

 

 

 

 

</td>

 

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

 

</table>

 

 

 

</td>

 

 

 

 

 

 

 

 

</table>

 

 

 

 

 

 

 

 

</telerik:RadToolTip>

 

 

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

 

 

</radG:GridTemplateColumn>

 

 

 

 

 

 

<%

 

--<ch:CampaignHover ID="CampaignHover2" runat="server" />

 

<asp:Panel ID="GridRowPnl" Width="100%" runat="server" >

<asp:LinkButton ID="lnkTitle" runat="server" ForeColor="black"

CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ContentID") %>'

Font-Underline="false" CssClass="labelText" CommandName="Select">

<%# DataBinder.Eval(Container.DataItem, "Title") %>

</asp:LinkButton>

</asp:Panel>

</ItemTemplate>

</telerik:GridTemplateColumn>

--

 

 

%>

 

 

 

<radG:GridTemplateColumn HeaderText="Objectives" DataField="Objectives" SortExpression="Objectives" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true">

 

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

 

<asp:Label ID="Objectives" runat="server" Text='<% # DataBinder.Eval(Container.DataItem, "Objectives") %>'></asp:Label>

 

 

 

</ItemTemplate>

 

 

 

 

 

 

 

</radG:GridTemplateColumn>

 

 

 

 

 

 

 

 

<radG:GridTemplateColumn HeaderText="Products" DataField="Products" SortExpression="Products" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" >

 

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

 

<asp:Label ID="Products" runat="server" Text='<% # DataBinder.Eval(Container.DataItem, "Products") %>'></asp:Label>

 

 

 

</ItemTemplate>

 

 

 

 

 

 

 

</radG:GridTemplateColumn>

 

 

 

 

 

 

 

 

</Columns>

 

 

 

 

 

 

 

 

</MasterTableView>

 

 

 

 

 

 

 

 

</radG:RadGrid>

 

 

 

 

 

 

 

</td>

 

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

 

</table>

 

 

 

 

 

<%

 

--<table border="0" cellpadding="0" cellspacing="0">

 

<tr>

<td class="data_blue_new">

<ucFB:FlexButton ID="btnSaveInPending" runat="server" CssClass="b_save_pending"/>

</td>

</tr>

</table>--

 

 

%>

 

 

<%

 

--<asp:LinkButton id="lnkWelcomeKitsOverview" runat="server" >welcome kits overview</asp:LinkButton>--%>

 

 

 

</ContentTemplate>

 

 

 

 

 

 

 

<uc2:ModalUpdateProgress id="ModalUpdateProgress1" runat="server" BackgroundCssClass="modalProgressGreyBackground" AssociatedUpdatePanelID="updPanel" DisplayAfter="0">

 

 

 

 

 

 

 

<ProgressTemplate>

 

 

 

 

 

 

 

<div class="modalPopup">

 

 

 

 

 

 

 

<b>Processing..</b>

 

 

 

 

 

 

 

<img src="App_Themes/Comcast1/ajax-loader.gif" align="middle" />

 

 

 

 

 

 

 

</div>

 

 

 

 

 

 

 

</ProgressTemplate>

 

 

 

 

 

 

 

</uc2:ModalUpdateProgress>

 

 

 

 

 

</

 

 

ContentTemplate>

 

</

 

 

asp:UpdatePanel>

 

</

 

 

asp:Content>

 

 

 

 

 

 

 

--------------------------------------
CampaingHeader.aspx.vb
----------------------------------

Imports

 

Infragistics.WebUI

 

 

Imports

 

System.Data

 

 

Imports

 

KMStore.Controller

 

 

Imports

 

System.Collections.Generic

 

 

Imports

 

Telerik.Web.UI

 

 

Imports

 

System.Configuration

 

 

Partial

 

Class CampaignHeader

 

 

 

Inherits KMStore.KMBasePage

 

#

 

Region " Constants "

 

 

 

Const ASCENDING As String = "ASC"

 

 

 

Const DESCENDING As String = "DESC"

 

 

 

Private navigationId As Int32

 

#

 

End Region

 

 

#

Region " Properties "

 

 

 

#

End Region

 

 

#

Region " Public Implementation "

 

 

 

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

 

 

 

Try

 

 

 

'Master.HideExceptionMessage()

 

 

 

'Session("UserId") = "b412fa2a-b1bc-4122-8617-d67ff08e50fd"

 

 

 

'UserName = "derek_grier@yahoo.com"

 

 

gvCampaign.Visible =

False

 

 

 

If Not Me.Page.IsPostBack Then

 

 

Session(

"TopMenuLevel") = ConfigurationManager.AppSettings("CampaignRoot")

 

Session(

 

"TopMenuGroup") = ConfigurationManager.AppSettings("GeneralGroupId")

 

 

 

'TODO: Make sure to set navigationId session variable to null or zero if we are navigating from anywhere other than left nav or top nav

 

 

 

' Get the navigation id from session

 

 

 

'Dim navigationId As Int32

 

 

 

If Not Request("navigationid") = "" Or Not IsNumeric(Request("navigationid")) Then

 

 

navigationId =

CLng(Request("navigationid"))

 

 

 

Else

 

 

 

If Not (Session("NavigationID") Is Nothing) Then

 

 

navigationId = Session(

"NavigationID")

 

 

 

End If

 

 

 

 

End If

 

 

 

'On this page navigationId 1 does not bring the all campaign results, If condition sets navigationId to 0 if its 1

 

 

 

If navigationId = 1 Then

 

 

navigationId = 0

 

End If

 

 

 

Dim cSetup As New ContentSetup

 

 

 

Dim dsLoad As New DataSet

 

dsLoad = cSetup.GetCampaignListPageLoad(Session(

 

"UserId").ToString, navigationId)

 

 

 

' add check box to list of Campaigns

 

 

 

Dim selectColumn As New System.Data.DataColumn

 

selectColumn.DataType = System.Type.GetType(

 

"System.Boolean")

 

selectColumn.ColumnName =

 

"Select"

 

 

selectColumn.DefaultValue =

False

 

 

dsLoad.Tables(

"Campaigns").Columns.Add(selectColumn)

 

 

 

' default rating to zero as opposed to Null

 

 

 

Dim dr As DataRow

 

 

 

For Each dr In dsLoad.Tables("Campaigns").Rows

 

 

 

If IsDBNull(dr("Rating")) Then dr("Rating") = 0

 

 

 

Next

 

 

 

' Set primary key on Campaigns data table

 

 

 

Dim pk(0) As DataColumn

 

pk(0) = dsLoad.Tables(

 

"Campaigns").Columns("contentId")

 

dsLoad.Tables(

 

"Campaigns").PrimaryKey = pk

 

Session.Add(

 

"dtCampaigns", dsLoad.Tables("Campaigns"))

 

chkHideThumbnails.Checked =

 

True

 

 

 

'gvCampaign.Visible = True

 

 

 

 

' Bind the Products list to the Products drop down list box

 

 

BindGrid()

 

If navigationId = 0 Then

 

 

 

'Me.KMFlashTitle1.FlashText = "Campaigns & Programs"

 

 

lblPageTitle.Text =

"Campaigns & Programs"

 

 

 

End If

 

 

 

Dim SiteNavigation As New SiteNavigationController

 

 

 

Dim root As String = ""

 

 

 

Dim groupID As String = ""

 

 

 

Dim pageTitle As String = ""

 

 

SiteNavigation.GetNavigationSessionVariables(navigationId, root, groupID, pageTitle)

Session(

"TopMenuLevel") = root

 

Session(

 

"TopMenuGroup") = groupID

 

Session(

 

"pageTitle") = pageTitle

 

 

 

' Set the page title

 

 

 

If (Not (Session("pageTitle") Is Nothing)) And (Session("pageTitle") <> "") Then

 

 

 

'Me.KMFlashTitle1.FlashText = Session("pageTitle")

 

 

lblPageTitle.Text = Session(

"pageTitle")

 

Master.GoogleTrack =

 

"/Home/CampaignHeader/" & Session("pageTitle")

 

 

 

Else

 

 

lblPageTitle.Text =

"Campaigns & Programs"

 

 

 

'Me.KMFlashTitle1.FlashText = "Campaigns & Programs"

 

 

Master.GoogleTrack =

"/Home/CampaignHeader/" & "Campaigns & Programs"

 

 

 

End If

 

 

 

End If

 

 

 

Catch ex As Exception

 

 

 

'Master.HandlePageException(ex)

 

 

 

End Try

 

 

 

End Sub

 

 

 

 

Protected Sub gvCampaign_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvCampaign.RowDataBound

 

 

 

Try

 

 

 

If e.Row.RowType = DataControlRowType.DataRow Then

 

 

 

' Get the tacitc hover control...

 

 

 

Dim hover As Parts_CampaignHoverMenuExtender

 

hover = e.Row.Cells(2).Controls(2).FindControl(

 

"CampaignHover1")

 

 

 

' Hide Hover controls if we have no data

 

 

 

If (CType(hover.FindControl("lblHoverUserID"), Label).Text.Trim = "") Then

 

 

 

CType(hover.FindControl("lblHoverUserIDTitle"), Label).Visible = False

 

 

 

CType(hover.FindControl("lblHoverUserID"), Label).Visible = False

 

 

 

End If

 

 

 

If (CType(hover.FindControl("lblHoverADID"), Label).Text.Trim = "") Then

 

 

 

CType(hover.FindControl("lblHoverADID"), Label).Visible = False

 

 

 

CType(hover.FindControl("lblHoverADIDTitle"), Label).Visible = False

 

 

 

End If

 

 

 

'If (CType(hover.FindControl("lblHoverTacticTypes"), Label).Text.Trim = "") Then

 

 

 

' CType(hover.FindControl("lblHoverTacticTypes"), Label).Visible = False

 

 

 

' CType(hover.FindControl("lblHoverTacticTypesTitle"), Label).Visible = False

 

 

 

'End If

 

 

 

If (CType(hover.FindControl("lblHoverProducts"), Label).Text.Trim = "") Then

 

 

 

CType(hover.FindControl("lblHoverProducts"), Label).Visible = False

 

 

 

CType(hover.FindControl("lblHoverProductssTitle"), Label).Visible = False

 

 

 

End If

 

 

 

If (CType(hover.FindControl("lblHoverObjectives"), Label).Text.Trim = "") Then

 

 

 

CType(hover.FindControl("lblHoverObjectives"), Label).Visible = False

 

 

 

CType(hover.FindControl("lblHoverObjectivesTitle"), Label).Visible = False

 

 

 

End If

 

 

 

If (CType(hover.FindControl("lblHoverDescription"), Label).Text.Trim = "") Then

 

 

 

CType(hover.FindControl("lblHoverDescription"), Label).Visible = False

 

 

 

CType(hover.FindControl("lblHoverDescriptionTitle"), Label).Visible = False

 

 

 

End If

 

 

 

If (CType(hover.FindControl("lblHoverPublishedDate"), Label).Text.Trim = "") Then

 

 

 

CType(hover.FindControl("lblHoverPublishedDate"), Label).Visible = False

 

 

 

CType(hover.FindControl("lblHoverPublishedDateTitle"), Label).Visible = False

 

 

 

End If

 

 

 

End If

 

 

 

Catch ex As Exception

 

 

 

'Master.HandlePageException(ex)

 

 

 

End Try

 

 

 

End Sub

 

 

 

#

Region " Private Implementation "

 

 

 

Private Sub NavigateToDetailPage(ByVal cId As String)

 

 

 

Dim nextPage As String = ""

 

 

 

Dim sessionContentIdName As String = ""

 

 

 

' Get the grid view's data source from view state

 

 

 

Dim dt As DataTable = CType(Session("dtCampaigns"), DataTable)

 

 

 

' what type of content is this?

 

 

 

Dim dr As DataRow = dt.Rows.Find(cId)

 

 

 

If Not (dr Is Nothing) Then

 

 

 

Dim contentTypeId As String = ""

 

 

 

If Not IsDBNull(dr.Item("ContentTypeID_FK")) Then

 

 

contentTypeId = dr.Item(

"ContentTypeID_FK").ToString

 

 

 

End If

 

 

 

Dim SiteNavController As New SiteNavigationController

 

SiteNavController.GetDetailPageByContentType(contentTypeId, nextPage, sessionContentIdName)

 

 

Else

 

 

 

Throw New Exception("Unable to navigate to detail page. Unable to Find row for content id: " & cId)

 

 

 

End If

 

 

 

'Used for Shorcuts and Derek Functions

 

 

Session(

"ContentID") = New Guid(cId)

 

 

 

' navigate to next page

 

 

Session(sessionContentIdName) = cId

Response.Redirect(nextPage &

"?ContentId=" & cId & "&navigationid=" & CLng(Request("navigationid")), False)

 

 

 

End Sub

 

 

 

Private Sub BindGrid()

 

 

 

' Get the selected GUID's for Product and Objective

 

 

 

Dim productId As String = ddlProducts.SelectedValue

 

 

 

Dim objectiveId As String = ddlObjectives.SelectedValue

 

 

 

'Dim mediaTypeId As String = ddlMediaTypes.SelectedValue

 

 

 

' Build the filter

 

 

 

Dim rowFilter As String = ""

 

 

 

If (productId <> "0") Then

 

 

rowFilter =

"ProductIds LIKE '%" & productId & "%' "

 

 

 

End If

 

 

 

If (objectiveId <> "0") Then

 

 

 

If (rowFilter.Length > 0) Then

 

 

rowFilter +=

" AND "

 

 

 

End If

 

 

rowFilter +=

"ObjectiveIds LIKE '%" & objectiveId & "%' "

 

 

 

End If

 

 

 

'If (mediaTypeId <> "0") Then

 

 

 

' If (rowFilter.Length > 0) Then

 

 

 

' rowFilter += " AND "

 

 

 

' End If

 

 

 

' rowFilter += "MediaTypeIds LIKE '%" & mediaTypeId & "%' "

 

 

 

'End If

 

 

 

' Get the rows in the datasource for this filter criteria

 

 

 

Dim dt As DataTable = CType(Session("dtCampaigns"), DataTable)

 

 

 

Dim dv As New DataView(dt)

 

dv.RowFilter = rowFilter

 

RadGrid1.DataSource = dv.ToTable

RadGrid1.DataBind()

 

 

 

Dim navigationId As Int32

 

 

 

If Not Request("navigationid") = "" Or Not IsNumeric(Request("navigationid")) Then

 

 

navigationId =

CLng(Request("navigationid"))

 

 

 

Else

 

 

 

If Not (Session("NavigationID") Is Nothing) Then

 

 

navigationId = Session(

"NavigationID")

 

 

 

End If

 

 

 

End If

 

 

 

For Each dataColumn As DataColumn In dt.Columns

 

 

 

Dim gridColumn As New RadGrid.MyCustomFilteringColumn(Session("UserId").ToString, navigationId)

 

 

 

Me.RadGrid1.MasterTableView.Columns.Add(gridColumn)

 

gridColumn.DataField = dataColumn.ColumnName

gridColumn.HeaderText = dataColumn.ColumnName

 

 

Next

 

 

 

End Sub

 

 

 

 

Protected Function BuildImageURL(ByVal thumbnail As Object) As String

 

 

 

Dim url As String = ""

 

 

 

Try

 

 

 

Dim utility As New KMStoreImageUtility

 

url = utility.BuildImageURL(thumbnail)

 

 

Catch ex As Exception

 

 

 

'Master.HandlePageException(ex)

 

 

 

End Try

 

 

 

Return url

 

 

 

End Function

 

 

#

End Region

 

 

 

 

Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.WebControls.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource

 

 

 

Dim dt As DataTable = CType(Session("dtCampaigns"), DataTable)

 

 

 

Me.RadGrid1.DataSource = dt

 

 

 

End Sub

 

 

 

Protected Sub RadGrid1_ColumnCreating(ByVal sender As Object, ByVal e As Telerik.WebControls.GridColumnCreatingEventArgs) Handles RadGrid1.ColumnCreating

 

 

 

If (e.ColumnType = GetType(RadGrid.MyCustomFilteringColumn).Name) Then

 

 

e.Column =

New RadGrid.MyCustomFilteringColumn(Session("UserId").ToString, navigationId)

 

 

 

End If

 

 

 

End Sub

 

 

 

Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.WebControls.GridCommandEventArgs) Handles RadGrid1.ItemCommand

 

 

 

If (e.CommandName = "Filter") Then

 

 

 

For Each column As GridColumn In e.Item.OwnerTableView.Columns

 

column.CurrentFilterValue =

 

String.Empty

 

column.CurrentFilterFunction = GridKnownFunction.NoFilter

 

 

Next

 

 

 

End If

 

 

 

End Sub

 

End

 

 

Class

 

 

----------------------------------
MyCustomFilteringColumn.vb
-------------------------------------

Imports

 

System.Data

 

 

Imports

 

RadGridFilter

 

 

Imports

 

Telerik.WebControls

 

 

Imports

 

System.Web.UI.WebControls

 

 

Imports

 

System.Web.UI

 

 

Imports

 

System

 

 

Imports

 

System.Data.OleDb

 

 

Imports

 

KMStore.DataServices

 

 

Imports

 

Microsoft.Practices.EnterpriseLibrary.Logging

 

 

Imports

 

KMStore.Controller

 

 

Namespace

 

RadGrid

 

 

 

' <summary>

 

 

 

' Custom column that shows filtering dropdown instead of textbox

 

 

 

' </summary>

 

 

 

'

 

 

 

Public Class MyCustomFilteringColumn

 

 

 

Inherits GridBoundColumn

 

 

 

Private strUserID As String

 

 

 

Private navigationID As Integer

 

 

 

Private dtCampainData As DataTable

 

 

 

Private _dataUtility As New KMStore.DataServices.DataUtility()

 

 

 

Private _metadataController As New MetadataController

 

 

 

Public Sub New(ByVal strSessionUserId As String, ByVal inavID As Integer)

 

strUserID = strSessionUserId

navigationID = inavID

 

 

End Sub

 

 

 

'RadGrid will cal this method when it initializes the controls inside the filtering item cells

 

 

 

Protected Overrides Sub SetupFilterControls(ByVal cell As TableCell)

 

 

 

MyBase.SetupFilterControls(cell)

 

cell.Controls.RemoveAt(0)

 

 

Dim combo As RadComboBox = New RadComboBox

 

combo.ID = (

 

"RadComboBox1" + Me.DataField)

 

combo.ShowToggleImage =

 

False

 

 

combo.Skin =

"Office2007"

 

 

combo.EnableLoadOnDemand =

True

 

 

combo.AutoPostBack =

True

 

 

combo.MarkFirstMatch =

True

 

 

combo.Height = Unit.Pixel(100)

 

AddHandler combo.ItemsRequested, AddressOf Me.list_ItemsRequested

 

 

 

AddHandler combo.SelectedIndexChanged, AddressOf Me.list_SelectedIndexChanged

 

cell.Controls.AddAt(0, combo)

cell.Controls.RemoveAt(1)

 

 

End Sub

 

 

 

'RadGrid will cal this method when the value should be set to the filtering input control(s)

 

 

 

Protected Overrides Sub SetCurrentFilterValueToControl(ByVal cell As TableCell)

 

 

 

MyBase.SetCurrentFilterValueToControl(cell)

 

 

 

Dim combo As RadComboBox = CType(cell.Controls(0), RadComboBox)

 

 

 

If (Me.CurrentFilterValue <> String.Empty) Then

 

 

combo.Text =

Me.CurrentFilterValue

 

 

 

End If

 

 

 

End Sub

 

 

 

'RadGrid will cal this method when the filtering value should be extracted from the filtering input control(s)

 

 

 

Protected Overrides Function GetCurrentFilterValueFromControl(ByVal cell As TableCell) As String

 

 

 

Dim combo As RadComboBox = CType(cell.Controls(0), RadComboBox)

 

 

 

Return combo.Text

 

 

 

End Function

 

 

 

 

Private Sub list_ItemsRequested(ByVal o As Object, ByVal e As RadComboBoxItemsRequestedEventArgs)

 

 

 

CType(o, RadComboBox).DataTextField = Me.DataField

 

 

 

CType(o, RadComboBox).DataValueField = Me.DataField

 

 

 

CType(o, RadComboBox).DataSource = GetCampaignListPageLoad(strUserID, navigationID)

 

 

 

CType(o, RadComboBox).DataBind()

 

 

 

End Sub

 

 

 

Private Sub list_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.WebControls.RadComboBoxSelectedIndexChangedEventArgs)

 

 

 

Dim filterItem As GridFilteringItem = CType(CType(o, RadComboBox).NamingContainer, GridFilteringItem)

 

 

 

If (Me.UniqueName = "Index") Then

 

 

 

'this is filtering for integer column type

 

 

filterItem.FireCommandEvent(

"Filter", New Pair("EqualTo", Me.UniqueName))

 

 

 

End If

 

 

 

'filtering for string column type

 

 

filterItem.FireCommandEvent(

"Filter", New Pair("Contains", Me.UniqueName))

 

 

 

End Sub

 

 

 

Public Function GetCampaignListPageLoad(ByVal userId As String, ByVal navigationID As Int32) As DataSet

 

 

 

Dim ds As New DataSet

 

 

 

Dim dt As DataTable

 

 

 

Dim oDAL As New KMStore.DataServices.KMStore.DAL.KMDAL

 

 

 

Try

 

 

 

' Get the product types

 

 

 

Dim param As New ParameterCollection

 

param.Add(

 

"ContentAttributeID", TypeCode.String, _metadataController.GetKeyValue("ProductSecondaryContentAttributeID"))

 

 

 

'_dataUtility.GetDataTable(_metadataController.GetStoredProcedureName("GetProductType"), ds, "ProductType", param)

 

 

dt = oDAL.GetDataTable(

"GetProductType", param)

 

dt.TableName =

 

"ProductType"

 

 

ds.Tables.Add(dt)

 

' Get the objective types

 

 

 

Dim p As New ParameterCollection

 

p.Add(

 

"ContentAttributeID", TypeCode.String, _metadataController.GetKeyValue("ObjectiveContentAttributeID"))

 

 

 

'_dataUtility.GetDataTable(_metadataController.GetStoredProcedureName("GetObjectiveType"), ds, "ObjectiveType", p)

 

 

dt = oDAL.GetDataTable(

"GetObjectiveType", p)

 

dt.TableName =

 

"ObjectiveType"

 

 

ds.Tables.Add(dt)

 

' Get the MediaTypes

 

 

p.Clear()

p.Add(

"ContentAttributeID", TypeCode.String, _metadataController.GetKeyValue("MediaTypeContentAttributeID"))

 

 

 

'_dataUtility.GetDataTable(_metadataController.GetStoredProcedureName("GetAttributeValuesByAttributeId"), _

 

 

 

'ds, "MediaType", p)

 

 

dt = oDAL.GetDataTable(

"GetAttributeValuesByAttributeId", p)

 

dt.TableName =

 

"MediaType"

 

 

ds.Tables.Add(dt)

 

' Build parameters collection

 

 

 

Dim parameters As New ParameterCollection

 

parameters.Add(

 

"ThumbnailContentAttributeID", TypeCode.String, _metadataController.GetKeyValue("ThumbnailContentAttributeID"))

 

parameters.Add(

 

"UserId", TypeCode.String, userId)

 

 

 

' Build a comma-separated list of contentTypeID expressions to test for a match

 

 

 

Dim contentTypeIDs As New ArrayList

 

contentTypeIDs.Add(_metadataController.GetKeyValue(

 

"CampaignContentTypeID"))

 

contentTypeIDs.Add(_metadataController.GetKeyValue(

 

"ProgramContentTypeID"))

 

contentTypeIDs.Add(_metadataController.GetKeyValue(

 

"GeneralContentContentTypeID"))

 

parameters.Add(

 

"contentTypeIDs", TypeCode.String, BuildListOfExpressions(contentTypeIDs))

 

 

 

If (navigationID > 0) Then

 

 

 

' Add the navigation id parameter

 

 

parameters.Add(

"NavigationID", TypeCode.Int32, navigationID)

 

 

 

' Get the contents for all campaigns and programs

 

 

 

'_dataUtility.GetDataTable(_metadataController.GetStoredProcedureName("GetContentAndDetailsByContentTypeNav"), _

 

 

 

' ds, "Campaigns", parameters)

 

 

dt = oDAL.GetDataTable(

"GetContentAndDetailsByContentTypeNav", parameters)

 

dt.TableName =

 

"Campaigns"

 

 

ds.Tables.Add(dt)

 

Else

 

 

parameters.Add(

"Root", TypeCode.String, CType(ConfigurationManager.AppSettings("CampaignRoot"), Int32))

 

parameters.Add(

 

"GroupId", TypeCode.String, CType(ConfigurationManager.AppSettings("GeneralGroupId"), Int32))

 

 

 

' Get the contents for all campaigns and programs

 

 

 

'_dataUtility.GetDataTable(_metadataController.GetStoredProcedureName("GetContentAndDetailsByContentTypeNavAll"), _

 

 

 

' ds, "Campaigns", parameters)

 

 

dt = oDAL.GetDataTable(

"GetContentAndDetailsByContentTypeNavAll", parameters)

 

dt.TableName =

 

"Campaigns"

 

 

ds.Tables.Add(dt)

 

End If

 

 

 

Catch ex As Exception

 

 

 

' Add information to the exception that is rethrown to provide more information when debugging

 

 

 

Dim exceptionMessage As String = "Unable to Get CampaignList PageLoad data"

 

 

 

' Throw a caught exception again using the throw statement.

 

 

 

Throw New KMStoreControllerException(exceptionMessage, ex)

 

 

 

End Try

 

 

 

Return ds

 

 

 

End Function

 

 

 

Public Function BuildListOfExpressions(ByVal expressions As ArrayList) As String

 

 

 

Dim listOfExpressions As New StringBuilder()

 

 

 

For Each expression As String In expressions

 

 

 

If (listOfExpressions.Length > 0) Then listOfExpressions.Append(",")

 

listOfExpressions.Append(expression)

 

 

Next

 

 

 

Return listOfExpressions.ToString

 

 

 

End Function

 

 

 

End Class

 

End

 

 

Namespace

 

 



Pavlina
Telerik team
 answered on 06 May 2009
1 answer
107 views
Hi,

I am displaying/inserting/deleting/updating on a RadGrid. Two of the columns are from the two different tables. I am displaying these two columns in Griddropdowncolumn when an insert/edit operations perform.

Table-1(Divisions) columns :   (PK)Division_ID, Division_Name
Table-2(Sections) Columns :   Section_ID, Section_Name, Division_ID(FK)


Table1(Divisions)              Table2(Sections)
----------------------              ----------------------
Mobile  ------------------------>Nokia
            ------------------------>Ericsson
            ------------------------>Samsug
            ------------------------>Motorola

Pens    ------------------------>rotomax
            ------------------------>calibur
            ------------------------>Halliburton

I am able to display all division in Griddropdownand all sections in another GridDropDown.  

What i need is when division mobile is selected, only  values from the mobile sections will have to display.

Please find the following code:
--------------------------------------------------------------------
<div style="text-align: center;">
        <span style="font-family: Arial; font-size: larger;">Resource Information<br />
            <br />
        </span>
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
            AllowAutomaticUpdates="True" AllowFilteringByColumn="True" AllowPaging="True"
            AllowSorting="True" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True"
            DataSourceID="SqlDataSource1" GridLines="None" ShowGroupPanel="True" Skin="Vista">
            <MasterTableView AutoGenerateColumns="False" CellSpacing="-1" CommandItemDisplay="TopAndBottom"
                DataKeyNames="Resource_ID" DataSourceID="SqlDataSource1" EditMode="PopUp">
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="Resource_ID" DataType="System.Int32" HeaderText="Resource_ID"
                        ReadOnly="True" SortExpression="Resource_ID" UniqueName="Resource_ID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Resource_Name" HeaderText="Resource_Name" SortExpression="Resource_Name"
                        UniqueName="Resource_Name">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Resource_Designation" HeaderText="Resource_Designation"
                        SortExpression="Resource_Designation" UniqueName="Resource_Designation">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Resource_EMail" HeaderText="Resource_EMail" SortExpression="Resource_EMail"
                        UniqueName="Resource_EMail">
                    </telerik:GridBoundColumn>
                    <telerik:GridDropDownColumn DataField="Division_ID" DataSourceID="SqlDataSource2"
                        HeaderText="Division" ListTextField="Division_Name" ListValueField="Division_ID"
                        DataType="System.Int32" UniqueName="UniqueDivisionName">
                    </telerik:GridDropDownColumn>
                    <telerik:GridDropDownColumn DataField="Section_ID" DataSourceID="SqlDataSource3"
                        HeaderText="Section" ListTextField="Section_Name" ListValueField="Section_ID"
                        DataType="System.Int32" UniqueName="UniqueSectionName">
                    </telerik:GridDropDownColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings AllowDragToGroup="True">
            </ClientSettings>
        </telerik:RadGrid><br />
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ResourceUtilizationDBConnectionString %>"
            SelectCommand="SELECT * FROM [Resource_Information]" ConflictDetection="CompareAllValues"
            DeleteCommand="DELETE FROM [Resource_Information] WHERE [Resource_ID] = @original_Resource_ID AND (([Resource_Name] = @original_Resource_Name) OR ([Resource_Name] IS NULL AND @original_Resource_Name IS NULL)) AND (([Resource_Designation] = @original_Resource_Designation) OR ([Resource_Designation] IS NULL AND @original_Resource_Designation IS NULL)) AND (([Resource_EMail] = @original_Resource_EMail) OR ([Resource_EMail] IS NULL AND @original_Resource_EMail IS NULL)) AND (([Division_ID] = @original_Division_ID) OR ([Division_ID] IS NULL AND @original_Division_ID IS NULL)) AND (([Section_ID] = @original_Section_ID) OR ([Section_ID] IS NULL AND @original_Section_ID IS NULL))"
            InsertCommand="INSERT INTO [Resource_Information] ([Resource_Name], [Resource_Designation], [Resource_EMail], [Division_ID], [Section_ID]) VALUES (@Resource_Name, @Resource_Designation, @Resource_EMail, @Division_ID, @Section_ID)"
            OldValuesParameterFormatString="original_{0}" UpdateCommand="UPDATE [Resource_Information] SET [Resource_Name] = @Resource_Name, [Resource_Designation] = @Resource_Designation, [Resource_EMail] = @Resource_EMail, [Division_ID] = @Division_ID, [Section_ID] = @Section_ID WHERE [Resource_ID] = @original_Resource_ID AND (([Resource_Name] = @original_Resource_Name) OR ([Resource_Name] IS NULL AND @original_Resource_Name IS NULL)) AND (([Resource_Designation] = @original_Resource_Designation) OR ([Resource_Designation] IS NULL AND @original_Resource_Designation IS NULL)) AND (([Resource_EMail] = @original_Resource_EMail) OR ([Resource_EMail] IS NULL AND @original_Resource_EMail IS NULL)) AND (([Division_ID] = @original_Division_ID) OR ([Division_ID] IS NULL AND @original_Division_ID IS NULL)) AND (([Section_ID] = @original_Section_ID) OR ([Section_ID] IS NULL AND @original_Section_ID IS NULL))">
            <DeleteParameters>
                <asp:Parameter Name="original_Resource_ID" Type="Int32" />
                <asp:Parameter Name="original_Resource_Name" Type="String" />
                <asp:Parameter Name="original_Resource_Designation" Type="String" />
                <asp:Parameter Name="original_Resource_EMail" Type="String" />
                <asp:Parameter Name="original_Division_ID" Type="Int32" />
                <asp:Parameter Name="original_Section_ID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="Resource_Name" Type="String" />
                <asp:Parameter Name="Resource_Designation" Type="String" />
                <asp:Parameter Name="Resource_EMail" Type="String" />
                <asp:Parameter Name="Division_ID" Type="Int32" />
                <asp:Parameter Name="Section_ID" Type="Int32" />
                <asp:Parameter Name="original_Resource_ID" Type="Int32" />
                <asp:Parameter Name="original_Resource_Name" Type="String" />
                <asp:Parameter Name="original_Resource_Designation" Type="String" />
                <asp:Parameter Name="original_Resource_EMail" Type="String" />
                <asp:Parameter Name="original_Division_ID" Type="Int32" />
                <asp:Parameter Name="original_Section_ID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="Resource_Name" Type="String" />
                <asp:Parameter Name="Resource_Designation" Type="String" />
                <asp:Parameter Name="Resource_EMail" Type="String" />
                <asp:Parameter Name="Division_ID" Type="Int32" />
                <asp:Parameter Name="Section_ID" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ResourceUtilizationDBConnectionString %>"
            SelectCommand="SELECT [Division_ID], [Division_Name] FROM [NSS_Divisions]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ResourceUtilizationDBConnectionString %>"
            SelectCommand="SELECT [Section_ID], [Section_Name] FROM [Division_Sections]"></asp:SqlDataSource>
    </div>
---------------------------------------------------------


Thanks.

Regards
Arshad





              
Shinu
Top achievements
Rank 2
 answered on 06 May 2009
1 answer
132 views
Hi

I have a question.
For example, my grid have 2 columns ID and Title and radgrid filtering enable. When page load I want filtering Title columns. 

radgrid1.columns..[index]...="My Title";

thank you


 
Princy
Top achievements
Rank 2
 answered on 06 May 2009
3 answers
432 views
I have a page set up with a RadAjaxManager in which I have a javascript call that utilizes the ajaxRequest client-side method.  The operation works fine, but upon clicking the link that fires that javascript, the loading panel does not display.  Is the loading panel not supported for a client-side request?

Josh
Dimo
Telerik team
 answered on 06 May 2009
1 answer
161 views
Hello,

I have got a grid. To create its footer I use a PagerTemplate. This is the code of my grid:

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> 
 
        <script type="text/javascript"> 
            var tableView = null; 
            function pageLoad(sender, args) { 
                tableView = $find("<%= grdMaestro.ClientID %>").get_masterTableView(); 
            } 
 
            function RadComboBox1_SelectedIndexChanged(sender, args) { 
                tableView.set_pageSize(sender.get_value()); 
            } 
 
            function changePage(argument) { 
                tableView.page(argument); 
            } 
 
            function RadNumericTextBox1_ValueChanged(sender, args) { 
                tableView.page(sender.get_value()); 
            } 
            function PaginaDetalles(sender, eventArgs) { 
                window.location = "fweDetalle.aspx"; 
            } 
        </script> 
         
    </telerik:RadScriptBlock> 
<asp:XmlDataSource ID="dsDatosMaestro" runat="server" DataFile="~/_Xml/DatosMaestro.xml"></asp:XmlDataSource> 
        <telerik:RadGrid ID="grdMaestro" runat="server" DataSourceID="dsDatosMaestro" AutoGenerateColumns="false"  
            AllowPaging="True" EnableEmbeddedSkins="False"  Skin="OT" GridLines="Vertical" AllowMultiRowSelection="true" 
            ><%-- OnItemDataBound="grdMaestro_ItemDataBound" --%>     
            <PagerStyle Mode="NextPrev" PageButtonCount="5" PagerTextFormat="{4} &nbsp; Nº Registros: <strong>{5}</strong>"  
            FirstPageToolTip="Primera página" PrevPageToolTip="Página anterior" NextPageToolTip="Siguiente página" LastPageToolTip="Última página" /> 
            <MasterTableView CellSpacing="-1"> 
                <Columns> 
                    <telerik:GridClientSelectColumn UniqueName="SelectColumn"> 
                        <HeaderStyle width="25px" /> 
                        <ItemStyle HorizontalAlign="Center"  /> 
                    </telerik:GridClientSelectColumn> 
                    <telerik:GridBoundColumn DataField="Código" HeaderText="Código" SortExpression="Código" UniqueName="Código"> 
                        <ItemStyle HorizontalAlign="Right" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Nombre" HeaderText="Nombre" SortExpression="Nombre" UniqueName="Nombre"> 
                        <ItemStyle HorizontalAlign="Left" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Fecha" HeaderText="Fecha" SortExpression="Fecha" UniqueName="Fecha"> 
                        <ItemStyle HorizontalAlign="Center" /> 
                    </telerik:GridBoundColumn> 
                </Columns> 
                <PagerTemplate> 
                    <span style="margin-top: 8px; margin-right: 5px; float: right;"> 
                        <asp:Label ID="lblRegistro" runat="server" Text="Nº Registros: "></asp:Label>  
                        <%# DataBinder.Eval(Container, "Paging.DataSourceCount")%> 
                    </span> 
                    <p style="margin: 0px;margin-top:3px; padding: 0px;float:left;margin-right:10px"> 
                        <asp:Button ID="btn1" runat="server" OnClientClick="changePage('first'); return false;" 
                            CommandName="Page" CommandArgument="Primero" CssClass="PagerButton FirstPage" /> 
                        <asp:Button ID="btn2" runat="server" OnClientClick="changePage('prev'); return false;" 
                            CommandName="Page" CommandArgument="Previo" CssClass="PagerButton PrevPage" /> 
                        <span style="vertical-align: middle;"> 
                            <asp:Label ID="lblPagina" runat="server" Text="Página:" /> 
                        </span> 
                        <telerik:RadNumericTextBox ID="RadNumericTextBox1" Skin="Office2007" Width="25px" 
                            Value='<%# (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") + 1 %>' 
                            runat="server"> 
                            <ClientEvents OnValueChanged="RadNumericTextBox1_ValueChanged" /> 
                            <NumberFormat DecimalDigits="0" /> 
                        </telerik:RadNumericTextBox> 
                        <span style="vertical-align: middle;"> 
                        <asp:Label ID="Label1" runat="server" Text="de"></asp:Label> 
                        <%# DataBinder.Eval(Container, "Paging.PageCount")%> 
                        </span> 
                        <asp:Button ID="btn3" runat="server" OnClientClick="changePage('next'); return false;" 
                            CommandName="Page" CommandArgument="Siguiente" CssClass="PagerButton NextPage" /> 
                        <asp:Button ID="btn4" runat="server" OnClientClick="changePage('last'); return false;" 
                            CommandName="Page" CommandArgument="Ultimo" CssClass="PagerButton LastPage" /> 
                        <asp:Panel runat="server" ID="NumericPagerPlaceHolder" > </asp:Panel> 
                     </p>  
                </PagerTemplate> 
            </MasterTableView> 
            <ClientSettings EnableRowHoverStyle="true"> 
                <Selecting AllowRowSelect="True" /> 
                <ClientMessages /> 
                <ClientEvents OnRowDblClick="PaginaDetalles" /> 
            </ClientSettings>    
        </telerik:RadGrid>  

I don´t know if you have noticed but pagertemplate is taken from your online demos jeje.

My problem is that tooltips are not shown.

do you know why?

thank you in advance.
Princy
Top achievements
Rank 2
 answered on 06 May 2009
0 answers
113 views

HI,

i use the RadTreeView with Checkboxes.

My Problem is the function "treeView.CheckedNodes" because the Return - Object is a IList<RadTreeNode>.

Sample Code:

       

 private void ShowCheckedNodes(RadTreeView treeView)  
        {  
             
 
            IList<RadTreeNode> nodeCollection = treeView.CheckedNodes;  
            foreach (RadTreeNode node in nodeCollection)  
            {  
                string x = node.FullPath;  
                 
            }  
             
        } 

What i need is a RadTreeNodeCollection as result. Let me describe in more detail:
What's important for me is the structure of the TreeView object, but only the selected nodes.

How can I achieve this?

Laz
Top achievements
Rank 1
 asked on 06 May 2009
1 answer
123 views

Hi, Iam having a scenario like this

on my webform I am having a combobox, a uploading file control,a Add button and a radGrid(it is having two columns combobox value column and fileNmae) .
In my combobox it is having some values (say A,B and C), I select a value from combobox and against that I browse for a file, after browsing a file when I click on Add button the combox value and the file path which is browsed should appear in radGrid.
How could I achieve this and one more thing one combobox selected value can have multiple files against them.

my source code is as follows :

<p><asp:Label ID="lblDocName" Text="Document Name" runat="server" /></p>
    <p><radG:RadComboBox ID="ddlDocName" runat="server" /></p>
    </div>
    <div>
    <p><asp:Label ID="lblAttachDoc" Text="Attach Document" runat="server" /></p>
    <p><asp:FileUpload ID="uplFileAttach" runat="server" Width="200px" /></p>
    </div>
    </div>
   
   
    <div >
    <asp:Button  ID="btnAdd" Text="Add" runat="server" />
    </div>
   
    
    <div>
    <radG:RadGrid ID="rgDocument" runat="server" Skin="Default" EnableEmbeddedSkins="False" Width="570px"  GridLines="None">
        <MasterTableView>
            <NoRecordsTemplate>
            </NoRecordsTemplate>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
            <RowIndicatorColumn>
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
        </MasterTableView>
     </radG:RadGrid>
    </div>


thanks,

Princy
Top achievements
Rank 2
 answered on 06 May 2009
1 answer
67 views
When I set a RadNumericTextbox to showSpinButtons = true, all of a sudden the whole control dissapears when I am in IE8 comatibility view! When select IE7, firefox or IE8 non compatibility view, it works just fine but just that one view!!

What do I need to do??? I am currently using Telerik.Web.UI version 2009.1.402.35. Is this a known issue? When will it be fixed?
Thanks


Dimo
Telerik team
 answered on 06 May 2009
1 answer
204 views
Hi
i want to bind a datasource to a Griddropdown column but when i bind it , but i face with some error like that reference to null object
here is my Aspx code:
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %> 
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
    <title>Untitled Page</title> 
    <style type="text/css"> 
 
 
.RadGrid_Default 
{ 
    border:1px solid #232323; 
} 
 
.RadGrid_Default 
{ 
    font:11px/1.4 arial,sans-serif; 
} 
 
.RadGrid_Default 
{ 
    background:#d4d0c8; 
    color:#333; 
} 
 
.MasterTable_Default 
{ 
    background:#fff; 
    border-collapse:separate !important; 
} 
 
.MasterTable_Default 
{ 
    font:11px/1.4 arial,sans-serif; 
} 
 
.GridHeader_Default 
{ 
    color:#fff; 
    text-decoration:none; 
} 
 
.GridHeader_Default 
{ 
    border-bottom:1px solid #010101; 
    background:url('mvwres://Telerik.Web.UI, Version=2008.3.1105.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4/Telerik.Web.UI.Skins.Default.Grid.headers.gif') repeat-x #434343; 
    padding:10px 6px 10px 11px; 
    text-align:left; 
    font-size:1.3em; 
    font-weight:normal; 
} 
 
.GridHeader_Default a 
{ 
    color:#fff; 
    text-decoration:none; 
} 
 
.RadGrid_Default .rgFilter 
{ 
    background-position:2px -897px; 
} 
 
.RadGrid_Default .rgFilter 
{ 
    width:16px; 
    height:16px; 
    border:0; 
    padding:0; 
    background-color:transparent; 
    background-image:url('mvwres://Telerik.Web.UI, Version=2008.3.1105.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4/Telerik.Web.UI.Skins.Default.Grid.sprite.gif'); 
    background-repeat:no-repeat; 
    vertical-align:middle; 
    cursor:pointer; 
} 
 
    </style> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <div> 
     
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> 
        </telerik:RadAjaxManager> 
     
    </div> 
    <asp:ScriptManager ID="ScriptManager1" runat="server"> 
    </asp:ScriptManager> 
    <telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None"  
        onprerender="RadGrid1_PreRender"> 
<HeaderContextMenu EnableTheming="True"> 
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
</HeaderContextMenu> 
 
<MasterTableView AutoGenerateColumns="False" DataKeyNames="source_code,source_row"> 
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
    <Columns> 
        <telerik:GridBoundColumn DataField="source_code" DataType="System.Decimal"  
            HeaderText="source_code" ReadOnly="True" SortExpression="source_code"  
            UniqueName="source_code"> 
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="source_row" DataType="System.Decimal"  
            HeaderText="source_row" ReadOnly="True" SortExpression="source_row"  
            UniqueName="source_row"> 
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="activity_id" DataType="System.Decimal"  
            HeaderText="activity_id" SortExpression="activity_id" UniqueName="activity_id"> 
        </telerik:GridBoundColumn>       
        <telerik:GridDropDownColumn UniqueName="source_desc" DataSourceID="SqlDataSource1" 
                        SortExpression="source_desc" ListTextField="lookup_nm" ListValueField="lookup_cd" 
                        HeaderText="Title of courtesy" DataField="source_desc" DropDownControlType="RadComboBox"  > 
                    </telerik:GridDropDownColumn> 
    </Columns> 
</MasterTableView> 
 
<FilterMenu EnableTheming="True"> 
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
</FilterMenu> 
    </telerik:RadGrid> 
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"  
        ConnectionString="<%$ ConnectionStrings:OrdersConnectionString %>"  
        SelectCommand="SELECT [lookup_cd], [lookup_nm] FROM [PB_lookup] WHERE ([lookup_id] = 'PB_source_header.company_typ_id')"> 
        <SelectParameters> 
            <asp:Parameter Name="lookup_id" Type="String" /> 
        </SelectParameters> 
    </asp:SqlDataSource> 
    </form> 
</body> 
</html> 
 
and here is my Cs code:
public partial class _Default : System.Web.UI.Page  
{ 
    protected void Page_Load(object sender, EventArgs e) 
    { 
        RadGrid1.MasterTableView.CommandItemDisplay = Telerik.Web.UI.GridCommandItemDisplay.TopAndBottom; 
        DataSet ds = new DataSet(); 
        SqlCommand cmd = new SqlCommand("Select * From PB_source_detail"); 
        SqlConnection mycon = new SqlConnection("Data Source=MONO-PC\\SQLEXPRESS;Initial Catalog=Orders;Integrated Security=True"); 
        mycon.Open(); 
        SqlDataAdapter SDA = new SqlDataAdapter(cmd.CommandText, mycon); 
        SDA.Fill(ds); 
        RadGrid1.DataSource = ds.Tables[0]; 
        mycon.Close(); 
 
    }   
}}
Do u know why?
Yavor
Telerik team
 answered on 06 May 2009
7 answers
410 views
New to Radgrid and we are doing an evaluation.  We have a table that is approximately 10,000 records, and each record has  approximately 30 fields.  This grid is read only and all of the columns are GridBoundColumns.  It takes approximately 30 secs for the grid to appear, and then it takes it an additional 2-3 secs to redraw.  We have watched the Telerik TV video re optimizing grid performance with only little noticeable increases in peformance.

How can we get the grid to come up faster.

Thanks in advance for a response.

John
Sebastian
Telerik team
 answered on 06 May 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?