Format BoundColumn Text
-
I know of ways to format text in a BoundColumn to decimals, numbers, etc but what I am after is a way of passing the text in a cell to a method I have created. Is there a way of doing this? Many thanks.
-
I know of ways to format text in a BoundColumn to decimals, numbers, etc but what I am after is a way of passing the text in a cell to a method I have created. Is there a way of doing this? Many thanks.
Hello, Could you explain your requirement on how and when you wish to pass the value to your method. Is there any specific action after you wish to pass the data. The normal procedure to pass the data could be in either of the given forms. For example:
private void button1_Click(object sender, EventArgs e) { //mymethod(this.dataGridView1.CurrentCell.Value); int row, col; row = 3; col = 2; mymethod(this.dataGridView1[col, row].Value); } public void mymethod(Object obj) { MessageBox.Show(obj.ToString()); }
I hope this helps. Regards, AllenAllen Smith ComponentOne LLC www.componentone.com
-
Hello, Could you explain your requirement on how and when you wish to pass the value to your method. Is there any specific action after you wish to pass the data. The normal procedure to pass the data could be in either of the given forms. For example:
private void button1_Click(object sender, EventArgs e) { //mymethod(this.dataGridView1.CurrentCell.Value); int row, col; row = 3; col = 2; mymethod(this.dataGridView1[col, row].Value); } public void mymethod(Object obj) { MessageBox.Show(obj.ToString()); }
I hope this helps. Regards, AllenAllen Smith ComponentOne LLC www.componentone.com
What I wish for is a method to be called each time a row is created that will take the text in a specific column and convert it. Table: Row Name Id 1 Ric 123 2 Lou 456 3 Matt 789 As a row is created a method takes the Id, runs it through a custom method I have (for converting ID's into Usernames) and then displays the username instead. I am using a SPGridView (SharePoint Grid View).
-
What I wish for is a method to be called each time a row is created that will take the text in a specific column and convert it. Table: Row Name Id 1 Ric 123 2 Lou 456 3 Matt 789 As a row is created a method takes the Id, runs it through a custom method I have (for converting ID's into Usernames) and then displays the username instead. I am using a SPGridView (SharePoint Grid View).