.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Filter Grid view data

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :WPF

HI all,

I m doing c# and I want to design a filter form with 5 different conditions. That means five combo boxes to select the table field, 5 combo boxes to select a criteria ('contains','equals to','greater than','less than') and five text boxes to enter values. When a user selecte five different field values and five different criterias, i want to show the filtered grid. I want to do this an efficeint way. How may i set the filter string dynamically according to the combo box values?

I am using binding source class.

please help



View Complete Post

More Related Resource Links

show data in grid view error Arithmetic operation resulted in an overflow.



i have a table there is 17 columns in 17 column 3 are number and other are varchar . when i try to display all data of that column error occures.

one more intersting think is when i try to display 6 column then grid show there data an no more error occures. 

when i run my project this error occures in grid view

Arithmetic operation resulted in an overflow. 

Unable to store combo box value to data grid view control

Hello,         I am using fw 3.5 SP1 with VS2008. I have bind my object collection with data grid view. I can see different values in combo box inside data grid view. But when I select any one value from combo box the selected value is changed to first value of combo box as soos as user leave the cell of the gird. Can anyone tell me where should I look for this problem so that my selected value remains same as user did select it.   Nilkanth Desai  

Problem of data grid view of xml file

Dear Friends I have a problem with XML View Data Grid. Earlier I create .xml file, then type first set of data tags then Right Click on it and select View Data Grid and Visual Studio 2005 gives me nice data grid view where I can able to enter data. But in Visual Studio 2008 I am not able to find that option. So friends kindly tell me how to enter data with data grid in xml file? I am using ASP.net with  C#, Visual Studio 2008, XML file for createing data source. Thank you.

Data View that handles both a Filter and "Show All"


I had a nice search facility up and running that filtered SQL data displayed in a Data View via a "contains" Filter clause on an entered string.

Pesky users now request a "Show All" button as well to display all data in the Data View.  For the life of me I cannot get this up and running - anybody got a tip/pointer?  I can't figure a combination of Filter criteria that would allow this.




unable to update data to databse from grid view


I have two tables in my database

using "innerconnect" i have show table content in grid view as      INV_NO            INV_DT        DN_NO       DN_DT   LR_NO        LR_DT .

where LR_NO is null .

I want to update it from grid view plz help


here  DN_NO  and INV_NO are primary keys

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace amar
    public partial class Form2 : Form
        SqlConnection con;
        SqlDataAdapter da1,da2;
        SqlCommandBuilder cb;

Need help on Select button column in Data Grid to populate fields in Form View


 When I have a select a row in a Data Grid that when I click on it I want it to show the info for the person I selected in a form view on the same page as the Data Grid. Here are the columns for the Data Grid that I have set up, the column is highlighted:

<asp:DataGrid ID="MHGrid" AutoGenerateColumns="False"  
        DataSourceID="MHFoundation" DataKeyField="POPULATION_LIST_ID" 
        AllowPaging="True" AllowSorting="True" BorderStyle="Solid" 
        BorderColor="#999999" BorderWidth="3px" CellPadding="4" PageSize="4" 
        CellSpacing="2" runat="server" BackColor="Gray" Font-Bold="False" 
        Font-Italic="False" Font-Overline="False" Font-Strikeout="False" 
        <SelectedItemStyle BackColor="#FF9900" Font-Bold="False" Font-Italic="False" 
            Font-Overline="False" Font-Strikeout="False" Font-Underline="False" />
            <asp:ButtonColumn CommandName="Select"  Text="Select"></asp:ButtonColumn>
            <asp:BoundColumn D

How to Disable Specific Column in Data Grid View and write something in Cell and load data in anothe


Hello All  ,

i have data grid view and i want to disable specific column from writing in it and in another column 

i want to write something like item code and load the item name automatically in the corresponding cell in the disabled column 

i hope that i write my problem correctly and you can understand what i want :)

thanks in advance ,

Kareem Naguib

Filter the grid view based on the textbox key press


i want to filter the gridview data based on textbox key press event.. I did it on button click event but how can i do it on textbox keypress event...


How to save the Entire Grid view data into sharepoint List using Visual Webparts ?


Hai Friends,

        I am Ali, I want to retrive the Entire Grid View data in to Sharepoint List using visual webparts. Present i am using FOR EACH condition for grid view, but it doest support for saving information into list items.

        and also i want to save the information that who has selected radio button in Grid View(Ex: If user select 'Present' or 'Absent' or 'OnDuty' or 'Leave' in these any one) that should be save in sharepoint list.

Please anybody help me,



How to retrive Data from SharePoint List to Data Grid View in Visual WebParts based on the Condition

Hi Friends... 
Here i write this Code for Retrieving Data Form SharePoint List to Data Grid view (st_attendance) in Visual Web parts....  But it doesn't work Properly....

SPWeb web = SPContext.Current.Web;
            SPList list = web.Lists["Student Profile"];
                string caml = string.Format(@"<Where><Eq><FieldRef Name='Academic Year' /><Value Type='Text'>{0}</Value></Eq></Where>",DropDownList2.Text );
                SPQuery query = new SPQuery(list.DefaultView);
                query.Query = caml;
                SPListItemCollection items = list.GetItems(query);
                st_attendence.DataSource = items;
                Controls.Add(st_attendence );

How to retrive Data from SharePoint List to Data Grid View in Visual WebParts based on the Condition

Hello Friends,

I am Srinivas, I want to know the How to retrive the Data from SharePoint List to Data Grid View in Visual WebParts based on the Condition.

Example: I want to retrive Students information from Lists to Grid View based on the Condition(based on 'Academic year' or 'Class' and 'Section'). In Student Status Page Grid view should be show the Student Details in their Status.

please any body help me



How to retrive Data from SharePoint List to Data Grid View in Visual WebParts based on the Condition


Hello Friends,

     I am Ali, I want to know How to retrive the Data from SharePoint List to Data Grid View in Visual WebParts based on the Condition.

Example: I want to retrive Students information from Lists to Grid View based on the Condition(based on 'Academic year' or 'Class' and 'Section').         In Student Status Page Grid view should be show the Student Details in their Status.

please any body help me



How to retrieve Data from SharePoint List to Data Grid View in Visual WebParts based on the Conditi


Hi Friends..

I am Srinivas Devi

I want to retrieve data from SharePoint List to Data Grid View using Visual Web parts. I want know how to write a LINQ query for retrieve data from Share Point List to Grid View based on two or More Conditions.

Like based on Employee Number, Employee Department etc...

Please Help me Sir..

Thank U Sir..



Grid view with filter


I need to filter a grid view based on Author dropdownlist. I thought there is a way to dynamically add the where clause
in the "onselecting" event of <asp:LinqDataSource>. But if I define the <asp:LinqDataSource as below, "onselecting" does not fire.

    <asp:LinqDataSource ID="dataSrcEco" runat="server"
        ContextTypeName="ECOTracker.DataAccess.ECOTrackerDataContext" EntityTypeName=""
        Select="new (EcoNumber, Description, Priority, Author, DocCoordinator)"
                TableName="Ecos" onselecting="Ecodatasource_Selecting">

For "onselecting" to fire I also need also add the "whereparameters" section in the linqdatasource as below.

    <asp:LinqDataSource ID="dataSrcEco" runat="server"
        ContextTypeName="ECOTracker.DataAccess.ECOTrackerDataContext" EntityTypeName=""
        Select="new (EcoNumber, D

Using Drop down menu in a grid view control for entering new data


I wish to use drop down menu(based on a table of my database) to update/insert data in a web form. The data is then fetch in to SQL table (Express).

How to do it ? 

how can i make the combo box in data grid view writable ?


Hello All ,

i want to make a combo box in data grid view column which allow me to read or write from it

the data grid view with column type of combo box only allow reading but i can't write 

how can i do that ? 

Kareem Naguib

How to bind data to a gridview with in another grid view


I have inserted a grid view with in another gridview and iam facing problem in binding the data to GridView2 ...I tried row editing event by using FindControl() method..but stuck at that point what to do next..

And iam using EDM to refer database...

i have writeen code as below to get the contol values...

protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
        GridView1.EditIndex = e.NewEditIndex;

after that where should i pass these values so that i can bind the data to grid view...

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend