PC Review


Reply
Thread Tools Rate Thread

Adding data to DataGrid

 
 
=?Utf-8?B?UGF0cmljaw==?=
Guest
Posts: n/a
 
      8th Aug 2007
I have got a prototype .Net2 WinForms that are binded to an Access DB Table
with some columns which have "default values".

I have allowed DataGrid to add data.

However, how could I get the "default values" in 2 columns to show up in new
row?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGF0cmljaw==?=
Guest
Posts: n/a
 
      8th Aug 2007
In addition, how could I control values that are allowed in another cell
value with a drop-down control?

"Patrick" wrote:

> I have got a prototype .Net2 WinForms that are binded to an Access DB Table
> with some columns which have "default values".
>
> I have allowed DataGrid to add data.
>
> However, how could I get the "default values" in 2 columns to show up in new
> row?

 
Reply With Quote
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      8th Aug 2007
Patrick,

Always try to access a DataGrid using the underlying dattable.

Cor

"Patrick" <(E-Mail Removed)> schreef in bericht
news:C2094410-090C-4764-85BD-(E-Mail Removed)...
> In addition, how could I control values that are allowed in another cell
> value with a drop-down control?
>
> "Patrick" wrote:
>
>> I have got a prototype .Net2 WinForms that are binded to an Access DB
>> Table
>> with some columns which have "default values".
>>
>> I have allowed DataGrid to add data.
>>
>> However, how could I get the "default values" in 2 columns to show up in
>> new
>> row?



 
Reply With Quote
 
=?Utf-8?B?UGF0cmljaw==?=
Guest
Posts: n/a
 
      8th Aug 2007
The DataGrid is already binded to the underlying DataTable.

But how do I code the grid so that
1) when a new row is inserted, I have default values pre-populated in 2
columns?
2) I have drop-down in 1 column to control values to be entered into the grid?


"Cor Ligthert [MVP]" wrote:

> Patrick,
>
> Always try to access a DataGrid using the underlying dattable.
>
> Cor
>
> "Patrick" <(E-Mail Removed)> schreef in bericht
> news:C2094410-090C-4764-85BD-(E-Mail Removed)...
> > In addition, how could I control values that are allowed in another cell
> > value with a drop-down control?
> >
> > "Patrick" wrote:
> >
> >> I have got a prototype .Net2 WinForms that are binded to an Access DB
> >> Table
> >> with some columns which have "default values".
> >>
> >> I have allowed DataGrid to add data.
> >>
> >> However, how could I get the "default values" in 2 columns to show up in
> >> new
> >> row?

>
>
>

 
Reply With Quote
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      8th Aug 2007
Patrick,

You know that you can set the default behaviour as well in the datatable. It
is a pity that this is not synchronized with by instance SQL server. You
have to set this in your program.

Cor

"Patrick" <(E-Mail Removed)> schreef in bericht
news:F2AAC264-A6EF-4F29-A7CC-(E-Mail Removed)...
> The DataGrid is already binded to the underlying DataTable.
>
> But how do I code the grid so that
> 1) when a new row is inserted, I have default values pre-populated in 2
> columns?
> 2) I have drop-down in 1 column to control values to be entered into the
> grid?
>
>
> "Cor Ligthert [MVP]" wrote:
>
>> Patrick,
>>
>> Always try to access a DataGrid using the underlying dattable.
>>
>> Cor
>>
>> "Patrick" <(E-Mail Removed)> schreef in bericht
>> news:C2094410-090C-4764-85BD-(E-Mail Removed)...
>> > In addition, how could I control values that are allowed in another
>> > cell
>> > value with a drop-down control?
>> >
>> > "Patrick" wrote:
>> >
>> >> I have got a prototype .Net2 WinForms that are binded to an Access DB
>> >> Table
>> >> with some columns which have "default values".
>> >>
>> >> I have allowed DataGrid to add data.
>> >>
>> >> However, how could I get the "default values" in 2 columns to show up
>> >> in
>> >> new
>> >> row?

>>
>>
>>


 
Reply With Quote
 
=?Utf-8?B?YmFycmFucg==?=
Guest
Posts: n/a
 
      8th Aug 2007
look at DataGridView_DefaultValuesNeeded and DataGridView_CellFormatting

"Cor Ligthert[MVP]" wrote:

> Patrick,
>
> You know that you can set the default behaviour as well in the datatable. It
> is a pity that this is not synchronized with by instance SQL server. You
> have to set this in your program.
>
> Cor
>
> "Patrick" <(E-Mail Removed)> schreef in bericht
> news:F2AAC264-A6EF-4F29-A7CC-(E-Mail Removed)...
> > The DataGrid is already binded to the underlying DataTable.
> >
> > But how do I code the grid so that
> > 1) when a new row is inserted, I have default values pre-populated in 2
> > columns?
> > 2) I have drop-down in 1 column to control values to be entered into the
> > grid?
> >
> >
> > "Cor Ligthert [MVP]" wrote:
> >
> >> Patrick,
> >>
> >> Always try to access a DataGrid using the underlying dattable.
> >>
> >> Cor
> >>
> >> "Patrick" <(E-Mail Removed)> schreef in bericht
> >> news:C2094410-090C-4764-85BD-(E-Mail Removed)...
> >> > In addition, how could I control values that are allowed in another
> >> > cell
> >> > value with a drop-down control?
> >> >
> >> > "Patrick" wrote:
> >> >
> >> >> I have got a prototype .Net2 WinForms that are binded to an Access DB
> >> >> Table
> >> >> with some columns which have "default values".
> >> >>
> >> >> I have allowed DataGrid to add data.
> >> >>
> >> >> However, how could I get the "default values" in 2 columns to show up
> >> >> in
> >> >> new
> >> >> row?
> >>
> >>
> >>

>
>

 
Reply With Quote
 
=?Utf-8?B?UGF0cmljaw==?=
Guest
Posts: n/a
 
      9th Aug 2007
Can someone explain how I can code the .Net 2 DataGrid such that when a new
row is added, I can have a drop down to control the values that go into a
particular column?

"barranr" wrote:

> look at DataGridView_DefaultValuesNeeded and DataGridView_CellFormatting
>
> "Cor Ligthert[MVP]" wrote:
>
> > Patrick,
> >
> > You know that you can set the default behaviour as well in the datatable. It
> > is a pity that this is not synchronized with by instance SQL server. You
> > have to set this in your program.
> >
> > Cor
> >
> > "Patrick" <(E-Mail Removed)> schreef in bericht
> > news:F2AAC264-A6EF-4F29-A7CC-(E-Mail Removed)...
> > > The DataGrid is already binded to the underlying DataTable.
> > >
> > > But how do I code the grid so that
> > > 1) when a new row is inserted, I have default values pre-populated in 2
> > > columns?
> > > 2) I have drop-down in 1 column to control values to be entered into the
> > > grid?
> > >
> > >
> > > "Cor Ligthert [MVP]" wrote:
> > >
> > >> Patrick,
> > >>
> > >> Always try to access a DataGrid using the underlying dattable.
> > >>
> > >> Cor
> > >>
> > >> "Patrick" <(E-Mail Removed)> schreef in bericht
> > >> news:C2094410-090C-4764-85BD-(E-Mail Removed)...
> > >> > In addition, how could I control values that are allowed in another
> > >> > cell
> > >> > value with a drop-down control?
> > >> >
> > >> > "Patrick" wrote:
> > >> >
> > >> >> I have got a prototype .Net2 WinForms that are binded to an Access DB
> > >> >> Table
> > >> >> with some columns which have "default values".
> > >> >>
> > >> >> I have allowed DataGrid to add data.
> > >> >>
> > >> >> However, how could I get the "default values" in 2 columns to show up
> > >> >> in
> > >> >> new
> > >> >> row?
> > >>
> > >>
> > >>

> >
> >

 
Reply With Quote
 
=?Utf-8?B?YmFycmFucg==?=
Guest
Posts: n/a
 
      9th Aug 2007
i = DataGridView.CurrentRow.Index
If rows = 0 Then
i = OrderDetailsDataGridView.Rows.GetRowCount
DataGridViewElementStates.Displayed) - 1
End If
DataGridView.Item(0, i).Value = Me.combobox.selectedvalue.tostring()

where 0 is the column and i is the row

"Patrick" wrote:

> Can someone explain how I can code the .Net 2 DataGrid such that when a new
> row is added, I can have a drop down to control the values that go into a
> particular column?
>
> "barranr" wrote:
>
> > look at DataGridView_DefaultValuesNeeded and DataGridView_CellFormatting
> >
> > "Cor Ligthert[MVP]" wrote:
> >
> > > Patrick,
> > >
> > > You know that you can set the default behaviour as well in the datatable. It
> > > is a pity that this is not synchronized with by instance SQL server. You
> > > have to set this in your program.
> > >
> > > Cor
> > >
> > > "Patrick" <(E-Mail Removed)> schreef in bericht
> > > news:F2AAC264-A6EF-4F29-A7CC-(E-Mail Removed)...
> > > > The DataGrid is already binded to the underlying DataTable.
> > > >
> > > > But how do I code the grid so that
> > > > 1) when a new row is inserted, I have default values pre-populated in 2
> > > > columns?
> > > > 2) I have drop-down in 1 column to control values to be entered into the
> > > > grid?
> > > >
> > > >
> > > > "Cor Ligthert [MVP]" wrote:
> > > >
> > > >> Patrick,
> > > >>
> > > >> Always try to access a DataGrid using the underlying dattable.
> > > >>
> > > >> Cor
> > > >>
> > > >> "Patrick" <(E-Mail Removed)> schreef in bericht
> > > >> news:C2094410-090C-4764-85BD-(E-Mail Removed)...
> > > >> > In addition, how could I control values that are allowed in another
> > > >> > cell
> > > >> > value with a drop-down control?
> > > >> >
> > > >> > "Patrick" wrote:
> > > >> >
> > > >> >> I have got a prototype .Net2 WinForms that are binded to an Access DB
> > > >> >> Table
> > > >> >> with some columns which have "default values".
> > > >> >>
> > > >> >> I have allowed DataGrid to add data.
> > > >> >>
> > > >> >> However, how could I get the "default values" in 2 columns to show up
> > > >> >> in
> > > >> >> new
> > > >> >> row?
> > > >>
> > > >>
> > > >>
> > >
> > >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding data to DataGrid =?Utf-8?B?UGF0cmljaw==?= Microsoft Dot NET Framework Forms 7 9th Aug 2007 07:08 PM
Adding external data into database data before it is sent to Control(Repeater, Datagrid, etc.) Neo Geshel Microsoft ADO .NET 2 17th Nov 2005 12:53 AM
Adding external data into database data before it is sent to Control(Repeater, Datagrid, etc.) Neo Geshel Microsoft ASP .NET 2 17th Nov 2005 12:53 AM
Adding external data into database data before it is sent to Control(Repeater, Datagrid, etc.) Neo Geshel Microsoft VB .NET 2 17th Nov 2005 12:53 AM
Adding Data in the DataGrid Carl Microsoft ADO .NET 2 23rd Sep 2004 06:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:50 AM.