|
-
Jan 10th, 2008, 02:43 PM
#1
Thread Starter
Hyperactive Member
types
I was wondering how to set a value for datagridcell. It is saying it is a type and cant be used as an expression
-
Jan 10th, 2008, 02:52 PM
#2
Re: types
 Originally Posted by tarik666
It is saying it is a type and cant be used as an expression
What is?
-
Jan 10th, 2008, 02:56 PM
#3
Thread Starter
Hyperactive Member
Re: types
Ok i just want to change the value of the data grid cell so i tried
datagridcell =5 but tht doesnt work
-
Jan 10th, 2008, 06:17 PM
#4
Re: types
What is your DataGrid bound to? Is it a DataTable? If so then you need to set the value in that table. A DataGridCell doesn't expose any value; only its coordinates. Let's say that you want to programmatically set the value of the current cell to a value from a TextBox:
vb.net Code:
Dim cell As DataGridCell = myDataGrid.CurrentCell myDataTable.DefaultView(cell.RowNumber)(cell.ColumnNumber) = myTextBox.Text
-
Jan 11th, 2008, 02:53 PM
#5
Thread Starter
Hyperactive Member
Re: types
Im using vb 2008 and that didnt work is there a way of changing it so it does work
-
Jan 11th, 2008, 03:40 PM
#6
Frenzied Member
Re: types
I'm just saying this for your beneficial:
If you're going to reply with a sentence for each of your posts, don't expect a resolution soon. You need to tell us what you did, where you put the code, why you put it there, what you expected to happen and what actually did, your code you are using, possibly some pseudo code, the error you are receiving, and more! I mean, seriously, just write a book. Spill out all the details, whether you think it is relevant or not.
This way, we can further help you. You can't be lazy with your posts and just expect someone to just give you the answer, especially when they can't tell what the problem is by the wording of your posts.
-
Jan 11th, 2008, 08:11 PM
#7
Re: types
It shouldn't take until post #5 for you to tell us which version you're using. Radio buttons are provided for the purpose when you create a thread. Please use them in future.
If you're using VB 2008 then I think it unlikely that you're using a DataGrid, unless you've upgraded a VB.NET 2002/2003 project. More likely you're using a DataGridView, in which case any advice regarding a DataGrid is likley to be irrelevant. Can you please tell us EXACTLY what type of grid you're using. It is important to be precise because it's easy to cause confusion otherwise and end up wasting everyone's time, your own included.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|