This is a migrated thread and some comments may be shown as answers.

filtering data which is not a field in grid's datasource

3 Answers 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Priya
Top achievements
Rank 1
Priya asked on 05 Aug 2008, 11:52 AM

Sir,

I have two tables and the grid is bound with the 1st table.But there is a column which shows data from the 2nd table.That is achieved by a userdefined funtion which returns the data based on the arguments(eg:foreignkey) passed to it.This fn is calld in each itemdatabound.The prblm is i want to filter that 2nd table data.As the filtering is applied on grid's bounded data,it becomes a prbm for me.
I Enter the filtering expression in txtFilter which is not a child ctrl of grid.
In the userdefined fn I store the args of the fn is a session object as

 

Protected

Function ParseMessage(ByVal nWFCode As Integer, ByVal bIsRejected As Boolean, _

ByVal bIsHistory As Boolean, Optional ByVal sType As String = "P", _

Optional ByVal sDocId As String = "", _

Optional ByVal dbConn As SqlConnection = Nothing) As String

sStatusDesc = WorkFlowMessages.GetMessage(nWFCode, bIsRejected, bIsHistory, sType, sDocId, dbConn)

If

(txtFilter.Text <> "" And txtFilter.Text = sStatusDesc) Then

ViewState(

"StatDocid") += sDocId + ","

End If

In NeedDataSource event

ds = GetDataSet()

Dim

docid As String = ViewState("StatDocid")

Dim filterExpression As String

Dim list As DropDownList = DirectCast(((txtFilter.NamingContainer).FindControl("drpFilterOnField")), DropDownList)

If (docid <> "") Then

Dim docidcnt As Integer = docid.Length

docid = docid.Remove(docidcnt - 1, 1)

filterExpression =

"(DocumentId in(" + docid + "))"

Dim dv As New DataView()

dv.Table = ds.Tables(0)

dv.RowFilter = filterExpression

WorkDetailsGrid.DataSource = dv

In WorkDetailsGrid_PreRender event

WorkDetailsGrid.MasterTableView.Rebind()

But it is not working.Is ther any way to solve my prbm.I bacme mad due to it
Plz help me....................

Thanks

3 Answers, 1 is accepted

Sort by
0
Priya
Top achievements
Rank 1
answered on 06 Aug 2008, 05:39 AM
plz help me.its urgent
0
Konstantin Petkov
Telerik team
answered on 06 Aug 2008, 06:01 AM
Hello Priya,

We are still expecting to see the results of the procedure we asked for in Ticket ID: 148295. Please get back to us there when the operation is completed.

Best wishes,
Konstantin Petkov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Priya
Top achievements
Rank 1
answered on 06 Aug 2008, 09:43 AM
Sir

I already send you the reply for that ticket no.I am using telerik from my company
Thanks
Tags
Grid
Asked by
Priya
Top achievements
Rank 1
Answers by
Priya
Top achievements
Rank 1
Konstantin Petkov
Telerik team
Share this question
or