dataView

Discussion in 'ASP .Net Datagrid Control' started by Esperanza, Mar 2, 2005.

  1. Esperanza

    Esperanza Guest

    Hello .net expert, I've made a litle reserch function which allow the user
    to find a client by name
    or phone number (both are string format) .

    Even if I know the value exist, the datagrid return me nothing.
    Any Idea what would be the problem ??
    Thanks in advance !!

    Esperanza

    //---------------------------------------------------------------------
    private void btnLookFor_Click(object sender, System.EventArgs e)
    {

    string strVar;
    string strSelection;
    strVar = this.txtLookFor.Text;
    strSelection = this.RadListLookFor.SelectedItem.Text;

    try
    {
    if (strVar.Trim()!=null)
    {
    //See witch radio button was click
    switch(strSelection)

    {
    //Look by name
    case "Name":
    this.dataViewGPPL.RowFilter = "XABALPH like '%" + strVar + "%'";
    break;


    //Look by phone number
    case "No tel.":
    this.dataViewGPPL.RowFilter = "XTEL like '" + strVar + "'";
    break;
    }

    this.DataGrid1.DataSource = dataViewGPPL;
    this.DataGrid1.DataBind();

    }


    }

    catch (Exception ex)
    {
    throw ex;
    }
     
    Esperanza, Mar 2, 2005
    #1
    1. Advertising

  2. Esperanza

    Elton Wang Guest

    Hi Esperanza,

    How do you fill whole data to the dataview?


    >-----Original Message-----
    >Hello .net expert, I've made a litle reserch function

    which allow the user
    >to find a client by name
    >or phone number (both are string format) .
    >
    >Even if I know the value exist, the datagrid return me

    nothing.
    >Any Idea what would be the problem ??
    >Thanks in advance !!
    >
    >Esperanza
    >
    >//--------------------------------------------------------

    -------------
    >private void btnLookFor_Click(object sender,

    System.EventArgs e)
    > {
    >
    > string strVar;
    > string strSelection;
    > strVar = this.txtLookFor.Text;
    > strSelection = this.RadListLookFor.SelectedItem.Text;
    >
    > try
    > {
    > if (strVar.Trim()!=null)
    > {
    > //See witch radio button was click
    > switch(strSelection)
    >
    > {
    > //Look by name
    > case "Name":
    > this.dataViewGPPL.RowFilter = "XABALPH like '%" +

    strVar + "%'";
    > break;
    >
    >
    > //Look by phone number
    > case "No tel.":
    > this.dataViewGPPL.RowFilter = "XTEL like '" +

    strVar + "'";
    > break;
    > }
    >
    > this.DataGrid1.DataSource = dataViewGPPL;
    > this.DataGrid1.DataBind();
    >
    > }
    >
    >
    > }
    >
    > catch (Exception ex)
    > {
    > throw ex;
    > }
    >
    >
    >
    >.
    >
     
    Elton Wang, Mar 2, 2005
    #2
    1. Advertising

  3. Esperanza

    Esperanza Guest

    That was it.
    I didn't fill the dataSet before.

    Thanks a lot !!
    Esperanza
    "Elton Wang" <> a écrit dans le message
    de news:39e301c51f63$faa778f0$...
    > Hi Esperanza,
    >
    > How do you fill whole data to the dataview?
    >
    >
    > >-----Original Message-----
    > >Hello .net expert, I've made a litle reserch function

    > which allow the user
    > >to find a client by name
    > >or phone number (both are string format) .
    > >
    > >Even if I know the value exist, the datagrid return me

    > nothing.
    > >Any Idea what would be the problem ??
    > >Thanks in advance !!
    > >
    > >Esperanza
    > >
    > >//--------------------------------------------------------

    > -------------
    > >private void btnLookFor_Click(object sender,

    > System.EventArgs e)
    > > {
    > >
    > > string strVar;
    > > string strSelection;
    > > strVar = this.txtLookFor.Text;
    > > strSelection = this.RadListLookFor.SelectedItem.Text;
    > >
    > > try
    > > {
    > > if (strVar.Trim()!=null)
    > > {
    > > //See witch radio button was click
    > > switch(strSelection)
    > >
    > > {
    > > //Look by name
    > > case "Name":
    > > this.dataViewGPPL.RowFilter = "XABALPH like '%" +

    > strVar + "%'";
    > > break;
    > >
    > >
    > > //Look by phone number
    > > case "No tel.":
    > > this.dataViewGPPL.RowFilter = "XTEL like '" +

    > strVar + "'";
    > > break;
    > > }
    > >
    > > this.DataGrid1.DataSource = dataViewGPPL;
    > > this.DataGrid1.DataBind();
    > >
    > > }
    > >
    > >
    > > }
    > >
    > > catch (Exception ex)
    > > {
    > > throw ex;
    > > }
    > >
    > >
    > >
    > >.
    > >
     
    Esperanza, Mar 2, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. William \(Bill\) Vaughn

    Re: non-unique indexes / dataview

    William \(Bill\) Vaughn, Jul 16, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    1,760
    jai hanuman
    Jul 17, 2003
  2. Denzil

    Query on DataView.Sort Property

    Denzil, Oct 21, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    2,295
    Chris Taylor
    Oct 23, 2003
  3. Ruslan

    DataTable and DataView

    Ruslan, Oct 29, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    14,089
  4. Nathan Baulch
    Replies:
    0
    Views:
    1,945
    Nathan Baulch
    Jun 26, 2003
  5. CodeMonkey
    Replies:
    1
    Views:
    767
    joyal jhaveri
    Feb 4, 2011
Loading...

Share This Page