TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vikas Ahlawat
NA
564
816.9k
Problem in Column Filter.
Apr 11 2011 4:39 AM
I have the list of checkbox according to these checkbox i want to filter the datatable
for this i have write the following code
foreach (ListItem lstItm in chklist_Companyfilter.Items)
{
if (lstItm.Selected == true)
{
QueryCompany += "\""+lstItm.Value+ "\","; // it gives result as "city","state"
}
}
if (QueryCompany != "")
{
QueryCompany = QueryCompany.Substring(0, QueryCompany.Length - 1);
}
Session["ColumnsNames"] = QueryCompany;
now i am passing this in the next page where i need to filter the table according to these column names
if (Session["ColumnsNames"] != null)
{
DataView dv = new DataView(ds.Tables[0]);
string s = Session["ColumnsNames"].ToString();
DataTable dt = dv.ToTable(true,s);
// it gives error but i put it static as DataTable dt = dv.ToTable(true, "asd","fdas"); then working
GridView1.DataSource = dt;
GridView1.DataBind();
ds.Clear();
dt.Clear();
Session["Result"] = null;
}
Please help me how can i filter the columns ?
Reply
Answers (
1
)
I am getting error "Illegal Characters in the Path"
How to find 'Images' folder of Application.