Retrieve Row From DataRepeater

How to get individual row from the datarepeater

Page 1 of 1

5 Replies - 4456 Views - Last Post: 03 December 2010 - 03:07 AM Rate Topic: -----

#1 Masterakos   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 31
  • Joined: 20-November 10

Retrieve Row From DataRepeater

Posted 02 December 2010 - 01:43 PM

Hello ppl,

I would like to ask you how i can get a dataRow from a datarepeater ...
I want to "choose" a row from my datarepeater and return the whole datarow to another form...I just dont know how to choose this datarow..I want to make this work with a button inside every cell..Like clicking the button and getting the datarow to a public variable.

private void FormCustomerSelection_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'videoCLubDatabaseDataSet.customers' table. You can move, or remove it, as needed.
            this.customersTableAdapter.FillByResults(this.videoCLubDatabaseDataSet.customers,"asda");
        }


This is the way to fill my dataset and view results inside my datarepeater ... Into the foto i attached you can see the results...Now i need the right code for the choosing button..
Attached Image


I tried a lot but i cant find the right way to do it ... Any info would be nice.

Thank you in advance :]

Is This A Good Question/Topic? 0
  • +

Replies To: Retrieve Row From DataRepeater

#2 mavarazo   User is offline

  • D.I.C Head
  • member icon

Reputation: 37
  • View blog
  • Posts: 182
  • Joined: 25-October 10

Re: Retrieve Row From DataRepeater

Posted 03 December 2010 - 12:11 AM

You could set in the new form a property to get the entire row object. When you click OK you handle the Dialogresult in the parent form and update/write back the edited row.
Was This Post Helpful? 1
  • +
  • -

#3 Masterakos   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 31
  • Joined: 20-November 10

Re: Retrieve Row From DataRepeater

Posted 03 December 2010 - 12:16 AM

View Postmavarazo, on 02 December 2010 - 11:11 PM, said:

You could set in the new form a property to get the entire row object. When you click OK you handle the Dialogresult in the parent form and update/write back the edited row.


Yea sounds good but i have no idea how i canset this property ... i mean its something like [ DataRepeater."something"."something"; ] ??? i need someone to give me an example..I will understand even if its not real code..Can u try mavarazo ?
Was This Post Helpful? 0
  • +
  • -

#4 mavarazo   User is offline

  • D.I.C Head
  • member icon

Reputation: 37
  • View blog
  • Posts: 182
  • Joined: 25-October 10

Re: Retrieve Row From DataRepeater

Posted 03 December 2010 - 12:33 AM

Ok :) (just a bit pseudo-code)

ParentForm:
public void Button_Click(object sender, Eventargs ea) {
   ChildForm frmChild = new ChildForm();
   frmChild.DataRow = current row

   if (frmChild.ShowDialog() == DialogResult.Ok) {
      update row = frmChild.DataRow;
   }
}



ChildForm:
private Row _dataRow;
public Row DataRow { 
   get { return _dataRow; }
   set { _dataRow = value; }
}


Was This Post Helpful? 1
  • +
  • -

#5 Masterakos   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 31
  • Joined: 20-November 10

Re: Retrieve Row From DataRepeater

Posted 03 December 2010 - 01:25 AM

i just did it and it works ... i understood the idea and the word "current" was the keyWord ! thank you a lot :(!):


:tooth:
Was This Post Helpful? 0
  • +
  • -

#6 mavarazo   User is offline

  • D.I.C Head
  • member icon

Reputation: 37
  • View blog
  • Posts: 182
  • Joined: 25-October 10

Re: Retrieve Row From DataRepeater

Posted 03 December 2010 - 03:07 AM

No problem mate :).

PS: Plz don't forget to rate my post ;)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1