Hi,
After searching around and not finding an answer I deicded to post...
Working on a project with several RadGrids in it.
The problem is the same across the board...
The code is using LinQtoSQL and Datatables...
An example would look like...
Private Sub btnSearch_Click(sender, e) handles btnSearch_Click()
DoSearch
End sub
Private Sub DoSearch()
using db as new DataContext
dim dt as new datatable
dt.columns.Add("UserName")
dt.columns.Add(UserImage")
dim users = _
from u in db.Users where u.UserName.Contains(txtSearch.Text)
Select u
for each u in users
dim dr as datarow = dt.newrow
dr.item("UserName") = u.username
if not isdbnull(u.Image) and not u.Image = "" then
dr.item("UserImage") = u.UserImage
else
dr.item("UserImage") = "Images/NoImage.gif"
end if
dt.rows.add(dr)
next
end using
RadGrid1.DataSource = dt
RadGrid1.Databind()
End Sub
If I use need data source by eliminating the databind in above and calling DoSearch in need datasource, the button click get ignored
but the larger issue is having to perform the entire search again just to page or sort...
I am not dealing with 10's of thousands of records, maybe 5k max and can pull what I need when a search is complete, but do not want to have to pull all records down just to page or sort the grid...
Short of writing a bunch of code to re-parametor the search, what is the best way to accomplish what I need with the RadGrid?
After searching around and not finding an answer I deicded to post...
Working on a project with several RadGrids in it.
The problem is the same across the board...
The code is using LinQtoSQL and Datatables...
An example would look like...
Private Sub btnSearch_Click(sender, e) handles btnSearch_Click()
DoSearch
End sub
Private Sub DoSearch()
using db as new DataContext
dim dt as new datatable
dt.columns.Add("UserName")
dt.columns.Add(UserImage")
dim users = _
from u in db.Users where u.UserName.Contains(txtSearch.Text)
Select u
for each u in users
dim dr as datarow = dt.newrow
dr.item("UserName") = u.username
if not isdbnull(u.Image) and not u.Image = "" then
dr.item("UserImage") = u.UserImage
else
dr.item("UserImage") = "Images/NoImage.gif"
end if
dt.rows.add(dr)
next
end using
RadGrid1.DataSource = dt
RadGrid1.Databind()
End Sub
If I use need data source by eliminating the databind in above and calling DoSearch in need datasource, the button click get ignored
but the larger issue is having to perform the entire search again just to page or sort...
I am not dealing with 10's of thousands of records, maybe 5k max and can pull what I need when a search is complete, but do not want to have to pull all records down just to page or sort the grid...
Short of writing a bunch of code to re-parametor the search, what is the best way to accomplish what I need with the RadGrid?