E
ewingate
I have a form with two text boxes, a button, and a datagrid control
which is bound to my SQL DB. There are two columns on the datagrid,
one for each of the textboxes on the form. I have already implemented
code which will put (both ints) data from the two columns into their
respective text boxes.
What I need to also implement is being able to enter numbers into each
textbox and then, at the push of the button, have the cooresponding
row of the datagrid to be both highlighted and displayed. Other rows
can be visible as well, I just need the one which was 'manually
selected' via the text boxes to show up in the display of the datagrid
control and to be selected.
I have written the following code which works but it is slow and seems
clumsy:
while((Convert.ToInt32(dgMYDB[0,iCount].Value) ! = iID) ||
((Convert.ToInt32(dgMYDB[1,iCount].Value) != iCust)))
{
iCount++;
}
dgMYDB[ 0, iCount ].Selected = true;
There did not seem to be an intuitive way to get the functionality
beyond iterating through all of the entries in the manner that I have
shown above. Would anyone know of a more elegant solution for this?
Thank you for your consideration,
ewingate
which is bound to my SQL DB. There are two columns on the datagrid,
one for each of the textboxes on the form. I have already implemented
code which will put (both ints) data from the two columns into their
respective text boxes.
What I need to also implement is being able to enter numbers into each
textbox and then, at the push of the button, have the cooresponding
row of the datagrid to be both highlighted and displayed. Other rows
can be visible as well, I just need the one which was 'manually
selected' via the text boxes to show up in the display of the datagrid
control and to be selected.
I have written the following code which works but it is slow and seems
clumsy:
while((Convert.ToInt32(dgMYDB[0,iCount].Value) ! = iID) ||
((Convert.ToInt32(dgMYDB[1,iCount].Value) != iCust)))
{
iCount++;
}
dgMYDB[ 0, iCount ].Selected = true;
There did not seem to be an intuitive way to get the functionality
beyond iterating through all of the entries in the manner that I have
shown above. Would anyone know of a more elegant solution for this?
Thank you for your consideration,
ewingate