S
sg
Hi
I'm starting programming in visual studio and c# and i have a problem
with filtering datagrid. I build form with datagrid and i see data from
database. I find in microsoft web page information how to create
filtering data grid but this doesn't work. What I must change? My form code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication10
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the
'minicrmDataSet1.adresy' table. You can move, or remove it, as needed.
this.adresyTableAdapter1.Fill(this.minicrmDataSet1.adresy);
}
//from microsoft web page
private void MakeDataView()
{
DataView dv = new DataView();
dv.Table = minicrmDataSet1.Tables["adresy"];
dv.AllowDelete = true;
dv.AllowEdit = true;
dv.AllowNew = true;
dv.RowFilter = "imie = 'Berlin'";
dv.RowStateFilter = DataViewRowState.ModifiedCurrent;
dv.Sort = "imie DESC";
// Simple bind to a TextBox control
Text1.DataBindings.Add("Text", dv, "imie");
}
//
}
}
Thank you in advance for your help
Sebastian
I'm starting programming in visual studio and c# and i have a problem
with filtering datagrid. I build form with datagrid and i see data from
database. I find in microsoft web page information how to create
filtering data grid but this doesn't work. What I must change? My form code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication10
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the
'minicrmDataSet1.adresy' table. You can move, or remove it, as needed.
this.adresyTableAdapter1.Fill(this.minicrmDataSet1.adresy);
}
//from microsoft web page
private void MakeDataView()
{
DataView dv = new DataView();
dv.Table = minicrmDataSet1.Tables["adresy"];
dv.AllowDelete = true;
dv.AllowEdit = true;
dv.AllowNew = true;
dv.RowFilter = "imie = 'Berlin'";
dv.RowStateFilter = DataViewRowState.ModifiedCurrent;
dv.Sort = "imie DESC";
// Simple bind to a TextBox control
Text1.DataBindings.Add("Text", dv, "imie");
}
//
}
}
Thank you in advance for your help
Sebastian