Filter Windows Form DataGridView using TextBox in Header (Header Row) in C# and VB.Net

Last Reply one year ago By dharmendr

Posted one year ago

I want to show searching text for each column inside datagridview under header in windows form and filter. How it can be done?

https://i.imgur.com/jbsO7oX.gif

        private void DisplayData()
        {
            con = new SqlDbConnect();
            con.SqlQuery("select ASID,ClassName,SectionName,SubjectName from tblAssignSubjects as asub inner join tblDefClass as dc on asub.ClassID=dc.ClassID inner join tblDefSection as ds on asub.SectionID=ds.SectionID inner join tblDefSubject as dsub on asub.SubjectID=dsub.SubjectID;");
            paging.SelectCommand = con.Cmd;
            sBuilder = new SqlCommandBuilder(paging);
            ds = new DataSet();
            paging.Fill(ds, "tblAssignSubjects");
            sTable = ds.Tables["tblAssignSubjects"];
            dGVAssinSub.DataSource = ds.Tables["tblAssignSubjects"].DefaultView;
            
            dGVAssinSub.ReadOnly = true;
        }
This question does not have replies that have been liked.