Home All Groups Group Topic Archive Search About

How to use one datagrid to update/insert into another

Author
11 Dec 2006 5:20 PM
shookim
I don't care how one suggests I do it, but I've been searching for days
on how to implement this concept.  I'm trying to use some kind of grid
control (doesn't have to be a grid control, whatever works best) to
display a dropdown menu of fields populated from table tblInvoiceData.
This control also includes a textbox which the user can input a value.
These two columns are side by side and not in a vertical layout.

The user then clicks on the "add" button and that particular field and
value displays in a grid (can be this original grid or another), BUT,
does not update the database tables until the user finshes adding all
their fields and then clicks on the UPDATE button, at which point
updates tblInvoiceData for this particular clientID.

HELP!!!

Author
11 Dec 2006 6:50 PM
RobinS
How many times are you going to re-post this? Cor's response
means this: You are asking too broad a question.

If the first control has only one value, use a combobox.
Bind it to your tblInvoiceData. Put a textbox next to it.
Put a button next to that. Add an event handler to the
button.

Put a grid on the bottom. When they click on the <Add> button,
add a record to the grid.

I think that's what you're going for.  Tackle the problems
one at a time. It seems like you're asking us to write the
whole thing for you. I'd do that for you, but you'll have
to send me a billing address... ;-)

Robin S.
-----------------------------
<shoo***@gmail.com> wrote in message
Show quoteHide quote
news:1165857631.911727.4610@73g2000cwn.googlegroups.com...
>I don't care how one suggests I do it, but I've been searching for days
> on how to implement this concept.  I'm trying to use some kind of grid
> control (doesn't have to be a grid control, whatever works best) to
> display a dropdown menu of fields populated from table tblInvoiceData.
> This control also includes a textbox which the user can input a value.
> These two columns are side by side and not in a vertical layout.
>
> The user then clicks on the "add" button and that particular field and
> value displays in a grid (can be this original grid or another), BUT,
> does not update the database tables until the user finshes adding all
> their fields and then clicks on the UPDATE button, at which point
> updates tblInvoiceData for this particular clientID.
>
> HELP!!!
>
Author
11 Dec 2006 7:06 PM
shookim
Moreso, I think his response is saying I'm asking too specific a
question.  I've actually done what you've described there, but the
problem with that is once the user tries to add another item, it
replaces the first value added to the 2nd grid.

RobinS wrote:
Show quoteHide quote
> How many times are you going to re-post this? Cor's response
> means this: You are asking too broad a question.
>
> If the first control has only one value, use a combobox.
> Bind it to your tblInvoiceData. Put a textbox next to it.
> Put a button next to that. Add an event handler to the
> button.
>
> Put a grid on the bottom. When they click on the <Add> button,
> add a record to the grid.
>
> I think that's what you're going for.  Tackle the problems
> one at a time. It seems like you're asking us to write the
> whole thing for you. I'd do that for you, but you'll have
> to send me a billing address... ;-)
>
> Robin S.
> -----------------------------
> <shoo***@gmail.com> wrote in message
> news:1165857631.911727.4610@73g2000cwn.googlegroups.com...
> >I don't care how one suggests I do it, but I've been searching for days
> > on how to implement this concept.  I'm trying to use some kind of grid
> > control (doesn't have to be a grid control, whatever works best) to
> > display a dropdown menu of fields populated from table tblInvoiceData.
> > This control also includes a textbox which the user can input a value.
> > These two columns are side by side and not in a vertical layout.
> >
> > The user then clicks on the "add" button and that particular field and
> > value displays in a grid (can be this original grid or another), BUT,
> > does not update the database tables until the user finshes adding all
> > their fields and then clicks on the UPDATE button, at which point
> > updates tblInvoiceData for this particular clientID.
> >
> > HELP!!!
> >
Author
11 Dec 2006 7:11 PM
RobinS
No, you're asking too broad a question. It's like someone
posted a question "Tell me about Windows Forms". Or "Tell me
about ADO.Net". Well, there are books of over a thousand
pages, how do you answer that in a newsgroup? Go buy a book.

This is a more specific question. Are you adding a row
to the 2nd grid before putting the values in? How are you
putting the values in / adding the information to the grid?
Post that code, and we can help you with it.

Robin S.
----------------------------------------
<shoo***@gmail.com> wrote in message
Show quoteHide quote
news:1165863972.268566.301470@16g2000cwy.googlegroups.com...
> Moreso, I think his response is saying I'm asking too specific a
> question.  I've actually done what you've described there, but the
> problem with that is once the user tries to add another item, it
> replaces the first value added to the 2nd grid.
>
> RobinS wrote:
>> How many times are you going to re-post this? Cor's response
>> means this: You are asking too broad a question.
>>
>> If the first control has only one value, use a combobox.
>> Bind it to your tblInvoiceData. Put a textbox next to it.
>> Put a button next to that. Add an event handler to the
>> button.
>>
>> Put a grid on the bottom. When they click on the <Add> button,
>> add a record to the grid.
>>
>> I think that's what you're going for.  Tackle the problems
>> one at a time. It seems like you're asking us to write the
>> whole thing for you. I'd do that for you, but you'll have
>> to send me a billing address... ;-)
>>
>> Robin S.
>> -----------------------------
>> <shoo***@gmail.com> wrote in message
>> news:1165857631.911727.4610@73g2000cwn.googlegroups.com...
>> >I don't care how one suggests I do it, but I've been searching for
>> >days
>> > on how to implement this concept.  I'm trying to use some kind of
>> > grid
>> > control (doesn't have to be a grid control, whatever works best) to
>> > display a dropdown menu of fields populated from table
>> > tblInvoiceData.
>> > This control also includes a textbox which the user can input a
>> > value.
>> > These two columns are side by side and not in a vertical layout.
>> >
>> > The user then clicks on the "add" button and that particular field
>> > and
>> > value displays in a grid (can be this original grid or another),
>> > BUT,
>> > does not update the database tables until the user finshes adding
>> > all
>> > their fields and then clicks on the UPDATE button, at which point
>> > updates tblInvoiceData for this particular clientID.
>> >
>> > HELP!!!
>> >
>
Author
11 Dec 2006 7:24 PM
shookim
look, I'm not going to argue about this.  The whole point of stating my
initial problem was for someone to possibly suggest a concept or
method, if there's something already out there that does something like
this.  If not, I gave a specific example of what I'm trying to do.


RobinS wrote:
Show quoteHide quote
> No, you're asking too broad a question. It's like someone
> posted a question "Tell me about Windows Forms". Or "Tell me
> about ADO.Net". Well, there are books of over a thousand
> pages, how do you answer that in a newsgroup? Go buy a book.
>
> This is a more specific question. Are you adding a row
> to the 2nd grid before putting the values in? How are you
> putting the values in / adding the information to the grid?
> Post that code, and we can help you with it.
>
> Robin S.
> ----------------------------------------
> <shoo***@gmail.com> wrote in message
> news:1165863972.268566.301470@16g2000cwy.googlegroups.com...
> > Moreso, I think his response is saying I'm asking too specific a
> > question.  I've actually done what you've described there, but the
> > problem with that is once the user tries to add another item, it
> > replaces the first value added to the 2nd grid.
> >
> > RobinS wrote:
> >> How many times are you going to re-post this? Cor's response
> >> means this: You are asking too broad a question.
> >>
> >> If the first control has only one value, use a combobox.
> >> Bind it to your tblInvoiceData. Put a textbox next to it.
> >> Put a button next to that. Add an event handler to the
> >> button.
> >>
> >> Put a grid on the bottom. When they click on the <Add> button,
> >> add a record to the grid.
> >>
> >> I think that's what you're going for.  Tackle the problems
> >> one at a time. It seems like you're asking us to write the
> >> whole thing for you. I'd do that for you, but you'll have
> >> to send me a billing address... ;-)
> >>
> >> Robin S.
> >> -----------------------------
> >> <shoo***@gmail.com> wrote in message
> >> news:1165857631.911727.4610@73g2000cwn.googlegroups.com...
> >> >I don't care how one suggests I do it, but I've been searching for
> >> >days
> >> > on how to implement this concept.  I'm trying to use some kind of
> >> > grid
> >> > control (doesn't have to be a grid control, whatever works best) to
> >> > display a dropdown menu of fields populated from table
> >> > tblInvoiceData.
> >> > This control also includes a textbox which the user can input a
> >> > value.
> >> > These two columns are side by side and not in a vertical layout.
> >> >
> >> > The user then clicks on the "add" button and that particular field
> >> > and
> >> > value displays in a grid (can be this original grid or another),
> >> > BUT,
> >> > does not update the database tables until the user finshes adding
> >> > all
> >> > their fields and then clicks on the UPDATE button, at which point
> >> > updates tblInvoiceData for this particular clientID.
> >> >
> >> > HELP!!!
> >> >
> >
Author
11 Dec 2006 10:00 PM
RobinS
Fair enough. I think it came across as one of those really
broad questions, and that's why you got the response you did.

I'll go look at your other posts, and if I can help you, I will.

Robin S.
-----------------------------
<shoo***@gmail.com> wrote in message
Show quoteHide quote
news:1165865056.432943.246020@l12g2000cwl.googlegroups.com...
> look, I'm not going to argue about this.  The whole point of stating
> my
> initial problem was for someone to possibly suggest a concept or
> method, if there's something already out there that does something
> like
> this.  If not, I gave a specific example of what I'm trying to do.
>
>
> RobinS wrote:
>> No, you're asking too broad a question. It's like someone
>> posted a question "Tell me about Windows Forms". Or "Tell me
>> about ADO.Net". Well, there are books of over a thousand
>> pages, how do you answer that in a newsgroup? Go buy a book.
>>
>> This is a more specific question. Are you adding a row
>> to the 2nd grid before putting the values in? How are you
>> putting the values in / adding the information to the grid?
>> Post that code, and we can help you with it.
>>
>> Robin S.
>> ----------------------------------------
>> <shoo***@gmail.com> wrote in message
>> news:1165863972.268566.301470@16g2000cwy.googlegroups.com...
>> > Moreso, I think his response is saying I'm asking too specific a
>> > question.  I've actually done what you've described there, but the
>> > problem with that is once the user tries to add another item, it
>> > replaces the first value added to the 2nd grid.
>> >
>> > RobinS wrote:
>> >> How many times are you going to re-post this? Cor's response
>> >> means this: You are asking too broad a question.
>> >>
>> >> If the first control has only one value, use a combobox.
>> >> Bind it to your tblInvoiceData. Put a textbox next to it.
>> >> Put a button next to that. Add an event handler to the
>> >> button.
>> >>
>> >> Put a grid on the bottom. When they click on the <Add> button,
>> >> add a record to the grid.
>> >>
>> >> I think that's what you're going for.  Tackle the problems
>> >> one at a time. It seems like you're asking us to write the
>> >> whole thing for you. I'd do that for you, but you'll have
>> >> to send me a billing address... ;-)
>> >>
>> >> Robin S.
>> >> -----------------------------
>> >> <shoo***@gmail.com> wrote in message
>> >> news:1165857631.911727.4610@73g2000cwn.googlegroups.com...
>> >> >I don't care how one suggests I do it, but I've been searching
>> >> >for
>> >> >days
>> >> > on how to implement this concept.  I'm trying to use some kind
>> >> > of
>> >> > grid
>> >> > control (doesn't have to be a grid control, whatever works best)
>> >> > to
>> >> > display a dropdown menu of fields populated from table
>> >> > tblInvoiceData.
>> >> > This control also includes a textbox which the user can input a
>> >> > value.
>> >> > These two columns are side by side and not in a vertical layout.
>> >> >
>> >> > The user then clicks on the "add" button and that particular
>> >> > field
>> >> > and
>> >> > value displays in a grid (can be this original grid or another),
>> >> > BUT,
>> >> > does not update the database tables until the user finshes
>> >> > adding
>> >> > all
>> >> > their fields and then clicks on the UPDATE button, at which
>> >> > point
>> >> > updates tblInvoiceData for this particular clientID.
>> >> >
>> >> > HELP!!!
>> >> >
>> >
>
Author
11 Dec 2006 7:29 PM
shookim
here's the code.

Dim cmdParam As SqlParameter
Dim ddlField As String = CType(e.Item.FindControl("ddlField"),
DropDownList).SelectedValue
Dim txtValue As String = CType(e.Item.FindControl("txtValue"),
TextBox).Text
Sub dgMassUpdate_Insert(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)

dsMassUpdate = Session("dsMassUpdate")
dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddlField) = txtValue

SqlConn.ConnectionString =
ConfigurationSettings.AppSettings("ConnectionString")
dgMassUpdate.EditItemIndex = -1

dgTemp.DataSource = dsMassUpdate
dgTemp.DataSource = CreateDataSource(ddlField, txtValue)

End Sub

    Function CreateDataSource(ByVal ddlField As String, ByVal txtValue
As String) As ICollection
        Dim table As New DataTable
        Dim tr As DataRow
        Dim td As DataColumn
        Dim newRow As DataRow
        newRow = table.NewRow()

        table.Columns.Add(New DataColumn(ddlField, GetType(String)))
        table.Columns.Add(New DataColumn(txtValue, GetType(String)))

        Dim dv As New DataView(table)
        Return dv
    End Function


RobinS wrote:
Show quoteHide quote
> No, you're asking too broad a question. It's like someone
> posted a question "Tell me about Windows Forms". Or "Tell me
> about ADO.Net". Well, there are books of over a thousand
> pages, how do you answer that in a newsgroup? Go buy a book.
>
> This is a more specific question. Are you adding a row
> to the 2nd grid before putting the values in? How are you
> putting the values in / adding the information to the grid?
> Post that code, and we can help you with it.
>
> Robin S.
> ----------------------------------------
> <shoo***@gmail.com> wrote in message
> news:1165863972.268566.301470@16g2000cwy.googlegroups.com...
> > Moreso, I think his response is saying I'm asking too specific a
> > question.  I've actually done what you've described there, but the
> > problem with that is once the user tries to add another item, it
> > replaces the first value added to the 2nd grid.
> >
> > RobinS wrote:
> >> How many times are you going to re-post this? Cor's response
> >> means this: You are asking too broad a question.
> >>
> >> If the first control has only one value, use a combobox.
> >> Bind it to your tblInvoiceData. Put a textbox next to it.
> >> Put a button next to that. Add an event handler to the
> >> button.
> >>
> >> Put a grid on the bottom. When they click on the <Add> button,
> >> add a record to the grid.
> >>
> >> I think that's what you're going for.  Tackle the problems
> >> one at a time. It seems like you're asking us to write the
> >> whole thing for you. I'd do that for you, but you'll have
> >> to send me a billing address... ;-)
> >>
> >> Robin S.
> >> -----------------------------
> >> <shoo***@gmail.com> wrote in message
> >> news:1165857631.911727.4610@73g2000cwn.googlegroups.com...
> >> >I don't care how one suggests I do it, but I've been searching for
> >> >days
> >> > on how to implement this concept.  I'm trying to use some kind of
> >> > grid
> >> > control (doesn't have to be a grid control, whatever works best) to
> >> > display a dropdown menu of fields populated from table
> >> > tblInvoiceData.
> >> > This control also includes a textbox which the user can input a
> >> > value.
> >> > These two columns are side by side and not in a vertical layout.
> >> >
> >> > The user then clicks on the "add" button and that particular field
> >> > and
> >> > value displays in a grid (can be this original grid or another),
> >> > BUT,
> >> > does not update the database tables until the user finshes adding
> >> > all
> >> > their fields and then clicks on the UPDATE button, at which point
> >> > updates tblInvoiceData for this particular clientID.
> >> >
> >> > HELP!!!
> >> >
> >
Author
11 Dec 2006 7:32 PM
shookim
oops, here it is again...

    Sub dgMassUpdate_Insert(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
        Dim cmdParam As SqlParameter
        Dim ddlField As String = CType(e.Item.FindControl("ddlField"),
DropDownList).SelectedValue
        Dim txtValue As String = CType(e.Item.FindControl("txtValue"),
TextBox).Text

        dsMassUpdate = Session("dsMassUpdate")
        dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddlField) =
txtValue

        SqlConn.ConnectionString =
ConfigurationSettings.AppSettings("ConnectionString")
        dgMassUpdate.EditItemIndex = -1

        dgTemp.DataSource = dsMassUpdate
        dgTemp.DataSource = CreateDataSource(ddlField, txtValue)

    End Sub

    Function CreateDataSource(ByVal ddlField As String, ByVal txtValue
As String) As ICollection
        Dim table As New DataTable
        Dim tr As DataRow
        Dim td As DataColumn
        Dim newRow As DataRow
        newRow = table.NewRow()

        table.Columns.Add(New DataColumn(ddlField, GetType(String)))
        table.Columns.Add(New DataColumn(txtValue, GetType(String)))

        Dim dv As New DataView(table)
        Return dv
    End Function


RobinS wrote:
Show quoteHide quote
> No, you're asking too broad a question. It's like someone
> posted a question "Tell me about Windows Forms". Or "Tell me
> about ADO.Net". Well, there are books of over a thousand
> pages, how do you answer that in a newsgroup? Go buy a book.
>
> This is a more specific question. Are you adding a row
> to the 2nd grid before putting the values in? How are you
> putting the values in / adding the information to the grid?
> Post that code, and we can help you with it.
>
> Robin S.
> ----------------------------------------
> <shoo***@gmail.com> wrote in message
> news:1165863972.268566.301470@16g2000cwy.googlegroups.com...
> > Moreso, I think his response is saying I'm asking too specific a
> > question.  I've actually done what you've described there, but the
> > problem with that is once the user tries to add another item, it
> > replaces the first value added to the 2nd grid.
> >
> > RobinS wrote:
> >> How many times are you going to re-post this? Cor's response
> >> means this: You are asking too broad a question.
> >>
> >> If the first control has only one value, use a combobox.
> >> Bind it to your tblInvoiceData. Put a textbox next to it.
> >> Put a button next to that. Add an event handler to the
> >> button.
> >>
> >> Put a grid on the bottom. When they click on the <Add> button,
> >> add a record to the grid.
> >>
> >> I think that's what you're going for.  Tackle the problems
> >> one at a time. It seems like you're asking us to write the
> >> whole thing for you. I'd do that for you, but you'll have
> >> to send me a billing address... ;-)
> >>
> >> Robin S.
> >> -----------------------------
> >> <shoo***@gmail.com> wrote in message
> >> news:1165857631.911727.4610@73g2000cwn.googlegroups.com...
> >> >I don't care how one suggests I do it, but I've been searching for
> >> >days
> >> > on how to implement this concept.  I'm trying to use some kind of
> >> > grid
> >> > control (doesn't have to be a grid control, whatever works best) to
> >> > display a dropdown menu of fields populated from table
> >> > tblInvoiceData.
> >> > This control also includes a textbox which the user can input a
> >> > value.
> >> > These two columns are side by side and not in a vertical layout.
> >> >
> >> > The user then clicks on the "add" button and that particular field
> >> > and
> >> > value displays in a grid (can be this original grid or another),
> >> > BUT,
> >> > does not update the database tables until the user finshes adding
> >> > all
> >> > their fields and then clicks on the UPDATE button, at which point
> >> > updates tblInvoiceData for this particular clientID.
> >> >
> >> > HELP!!!
> >> >
> >
Author
11 Dec 2006 10:06 PM
RobinS
Well, right off the bat, without completely understanding
everything, this looks like an issue:

dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddlField) =
txtValue

If you use Rows(0), it will always put it in the first row.

Is dbMassUpdate your data grid that you are inserting their
selection into? What is dgTemp?

If anybody else out there has an opinion, please feel free to
chime in!

Robin S.
-------------------------------
<shoo***@gmail.com> wrote in message
Show quoteHide quote
news:1165865542.533756.109940@j72g2000cwa.googlegroups.com...
> oops, here it is again...
>
>    Sub dgMassUpdate_Insert(ByVal sender As Object, ByVal e As
> DataGridCommandEventArgs)
>        Dim cmdParam As SqlParameter
>        Dim ddlField As String = CType(e.Item.FindControl("ddlField"),
> DropDownList).SelectedValue
>        Dim txtValue As String = CType(e.Item.FindControl("txtValue"),
> TextBox).Text
>
>        dsMassUpdate = Session("dsMassUpdate")
>        dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddlField) =
> txtValue
>
>        SqlConn.ConnectionString =
> ConfigurationSettings.AppSettings("ConnectionString")
>        dgMassUpdate.EditItemIndex = -1
>
>        dgTemp.DataSource = dsMassUpdate
>        dgTemp.DataSource = CreateDataSource(ddlField, txtValue)
>
>    End Sub
>
>    Function CreateDataSource(ByVal ddlField As String, ByVal txtValue
> As String) As ICollection
>        Dim table As New DataTable
>        Dim tr As DataRow
>        Dim td As DataColumn
>        Dim newRow As DataRow
>        newRow = table.NewRow()
>
>        table.Columns.Add(New DataColumn(ddlField, GetType(String)))
>        table.Columns.Add(New DataColumn(txtValue, GetType(String)))
>
>        Dim dv As New DataView(table)
>        Return dv
>    End Function
>
>
> RobinS wrote:
>> No, you're asking too broad a question. It's like someone
>> posted a question "Tell me about Windows Forms". Or "Tell me
>> about ADO.Net". Well, there are books of over a thousand
>> pages, how do you answer that in a newsgroup? Go buy a book.
>>
>> This is a more specific question. Are you adding a row
>> to the 2nd grid before putting the values in? How are you
>> putting the values in / adding the information to the grid?
>> Post that code, and we can help you with it.
>>
>> Robin S.
>> ----------------------------------------
>> <shoo***@gmail.com> wrote in message
>> news:1165863972.268566.301470@16g2000cwy.googlegroups.com...
>> > Moreso, I think his response is saying I'm asking too specific a
>> > question.  I've actually done what you've described there, but the
>> > problem with that is once the user tries to add another item, it
>> > replaces the first value added to the 2nd grid.
>> >
>> > RobinS wrote:
>> >> How many times are you going to re-post this? Cor's response
>> >> means this: You are asking too broad a question.
>> >>
>> >> If the first control has only one value, use a combobox.
>> >> Bind it to your tblInvoiceData. Put a textbox next to it.
>> >> Put a button next to that. Add an event handler to the
>> >> button.
>> >>
>> >> Put a grid on the bottom. When they click on the <Add> button,
>> >> add a record to the grid.
>> >>
>> >> I think that's what you're going for.  Tackle the problems
>> >> one at a time. It seems like you're asking us to write the
>> >> whole thing for you. I'd do that for you, but you'll have
>> >> to send me a billing address... ;-)
>> >>
>> >> Robin S.
>> >> -----------------------------
>> >> <shoo***@gmail.com> wrote in message
>> >> news:1165857631.911727.4610@73g2000cwn.googlegroups.com...
>> >> >I don't care how one suggests I do it, but I've been searching
>> >> >for
>> >> >days
>> >> > on how to implement this concept.  I'm trying to use some kind
>> >> > of
>> >> > grid
>> >> > control (doesn't have to be a grid control, whatever works best)
>> >> > to
>> >> > display a dropdown menu of fields populated from table
>> >> > tblInvoiceData.
>> >> > This control also includes a textbox which the user can input a
>> >> > value.
>> >> > These two columns are side by side and not in a vertical layout.
>> >> >
>> >> > The user then clicks on the "add" button and that particular
>> >> > field
>> >> > and
>> >> > value displays in a grid (can be this original grid or another),
>> >> > BUT,
>> >> > does not update the database tables until the user finshes
>> >> > adding
>> >> > all
>> >> > their fields and then clicks on the UPDATE button, at which
>> >> > point
>> >> > updates tblInvoiceData for this particular clientID.
>> >> >
>> >> > HELP!!!
>> >> >
>> >
>
Author
11 Dec 2006 11:14 PM
shookim
my main dataset is dsMassUpdate which I fill early in early piece of
the code.  dgMassUpdate is the first datagrid, where I'm performing the
update to the dataset.  dgTemp is the second datagrid which gets
populated with the field and value from the first datagrid.

What I'm trying to do is allow the user to update each field with a
value they enter by updating the dataset and not the database.  When
the user is finally finished with selecting all the fields and adding
values for the field to be updated with, THEN they hit the UPDATE
button which updates the db.

The purpose of the second datagrid was just to display what fields and
values the user selected and entered.  This data doesn't actually get
updated to the database immediately.

RobinS wrote:
Show quoteHide quote
> Well, right off the bat, without completely understanding
> everything, this looks like an issue:
>
> dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddlField) =
> txtValue
>
> If you use Rows(0), it will always put it in the first row.
>
> Is dbMassUpdate your data grid that you are inserting their
> selection into? What is dgTemp?
>
> If anybody else out there has an opinion, please feel free to
> chime in!
>
> Robin S.
> -------------------------------
> <shoo***@gmail.com> wrote in message
> news:1165865542.533756.109940@j72g2000cwa.googlegroups.com...
> > oops, here it is again...
> >
> >    Sub dgMassUpdate_Insert(ByVal sender As Object, ByVal e As
> > DataGridCommandEventArgs)
> >        Dim cmdParam As SqlParameter
> >        Dim ddlField As String = CType(e.Item.FindControl("ddlField"),
> > DropDownList).SelectedValue
> >        Dim txtValue As String = CType(e.Item.FindControl("txtValue"),
> > TextBox).Text
> >
> >        dsMassUpdate = Session("dsMassUpdate")
> >        dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddlField) =
> > txtValue
> >
> >        SqlConn.ConnectionString =
> > ConfigurationSettings.AppSettings("ConnectionString")
> >        dgMassUpdate.EditItemIndex = -1
> >
> >        dgTemp.DataSource = dsMassUpdate
> >        dgTemp.DataSource = CreateDataSource(ddlField, txtValue)
> >
> >    End Sub
> >
> >    Function CreateDataSource(ByVal ddlField As String, ByVal txtValue
> > As String) As ICollection
> >        Dim table As New DataTable
> >        Dim tr As DataRow
> >        Dim td As DataColumn
> >        Dim newRow As DataRow
> >        newRow = table.NewRow()
> >
> >        table.Columns.Add(New DataColumn(ddlField, GetType(String)))
> >        table.Columns.Add(New DataColumn(txtValue, GetType(String)))
> >
> >        Dim dv As New DataView(table)
> >        Return dv
> >    End Function
> >
> >
> > RobinS wrote:
> >> No, you're asking too broad a question. It's like someone
> >> posted a question "Tell me about Windows Forms". Or "Tell me
> >> about ADO.Net". Well, there are books of over a thousand
> >> pages, how do you answer that in a newsgroup? Go buy a book.
> >>
> >> This is a more specific question. Are you adding a row
> >> to the 2nd grid before putting the values in? How are you
> >> putting the values in / adding the information to the grid?
> >> Post that code, and we can help you with it.
> >>
> >> Robin S.
> >> ----------------------------------------
> >> <shoo***@gmail.com> wrote in message
> >> news:1165863972.268566.301470@16g2000cwy.googlegroups.com...
> >> > Moreso, I think his response is saying I'm asking too specific a
> >> > question.  I've actually done what you've described there, but the
> >> > problem with that is once the user tries to add another item, it
> >> > replaces the first value added to the 2nd grid.
> >> >
> >> > RobinS wrote:
> >> >> How many times are you going to re-post this? Cor's response
> >> >> means this: You are asking too broad a question.
> >> >>
> >> >> If the first control has only one value, use a combobox.
> >> >> Bind it to your tblInvoiceData. Put a textbox next to it.
> >> >> Put a button next to that. Add an event handler to the
> >> >> button.
> >> >>
> >> >> Put a grid on the bottom. When they click on the <Add> button,
> >> >> add a record to the grid.
> >> >>
> >> >> I think that's what you're going for.  Tackle the problems
> >> >> one at a time. It seems like you're asking us to write the
> >> >> whole thing for you. I'd do that for you, but you'll have
> >> >> to send me a billing address... ;-)
> >> >>
> >> >> Robin S.
> >> >> -----------------------------
> >> >> <shoo***@gmail.com> wrote in message
> >> >> news:1165857631.911727.4610@73g2000cwn.googlegroups.com...
> >> >> >I don't care how one suggests I do it, but I've been searching
> >> >> >for
> >> >> >days
> >> >> > on how to implement this concept.  I'm trying to use some kind
> >> >> > of
> >> >> > grid
> >> >> > control (doesn't have to be a grid control, whatever works best)
> >> >> > to
> >> >> > display a dropdown menu of fields populated from table
> >> >> > tblInvoiceData.
> >> >> > This control also includes a textbox which the user can input a
> >> >> > value.
> >> >> > These two columns are side by side and not in a vertical layout.
> >> >> >
> >> >> > The user then clicks on the "add" button and that particular
> >> >> > field
> >> >> > and
> >> >> > value displays in a grid (can be this original grid or another),
> >> >> > BUT,
> >> >> > does not update the database tables until the user finshes
> >> >> > adding
> >> >> > all
> >> >> > their fields and then clicks on the UPDATE button, at which
> >> >> > point
> >> >> > updates tblInvoiceData for this particular clientID.
> >> >> >
> >> >> > HELP!!!
> >> >> >
> >> >
> >
Author
12 Dec 2006 3:18 AM
RobinS
Okay, let me try this again:

dsMassUpdate is your actual dataset that is going to be updated?

dgMassUpdate is a datagrid that shows the dataset dsMassUpdate?
Or does it show a list of fields in dsMassUpdate? So they pick
a field name and put the new value in the textbox and click a
button and it adds it to dgTemp?

Then when they're done, they apply all the updates to the
dataset dsMassUpdate?

Am I understanding your process yet?

Robin S.
-------------------------------------------
<shoo***@gmail.com> wrote in message
Show quoteHide quote
news:1165878860.214907.179770@l12g2000cwl.googlegroups.com...
> my main dataset is dsMassUpdate which I fill early in early piece of
> the code.  dgMassUpdate is the first datagrid, where I'm performing
> the
> update to the dataset.  dgTemp is the second datagrid which gets
> populated with the field and value from the first datagrid.
>
> What I'm trying to do is allow the user to update each field with a
> value they enter by updating the dataset and not the database.  When
> the user is finally finished with selecting all the fields and adding
> values for the field to be updated with, THEN they hit the UPDATE
> button which updates the db.
>
> The purpose of the second datagrid was just to display what fields and
> values the user selected and entered.  This data doesn't actually get
> updated to the database immediately.
>
> RobinS wrote:
>> Well, right off the bat, without completely understanding
>> everything, this looks like an issue:
>>
>> dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddlField) =
>> txtValue
>>
>> If you use Rows(0), it will always put it in the first row.
>>
>> Is dbMassUpdate your data grid that you are inserting their
>> selection into? What is dgTemp?
>>
>> If anybody else out there has an opinion, please feel free to
>> chime in!
>>
>> Robin S.
>> -------------------------------
>> <shoo***@gmail.com> wrote in message
>> news:1165865542.533756.109940@j72g2000cwa.googlegroups.com...
>> > oops, here it is again...
>> >
>> >    Sub dgMassUpdate_Insert(ByVal sender As Object, ByVal e As
>> > DataGridCommandEventArgs)
>> >        Dim cmdParam As SqlParameter
>> >        Dim ddlField As String =
>> > CType(e.Item.FindControl("ddlField"),
>> > DropDownList).SelectedValue
>> >        Dim txtValue As String =
>> > CType(e.Item.FindControl("txtValue"),
>> > TextBox).Text
>> >
>> >        dsMassUpdate = Session("dsMassUpdate")
>> >        dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddlField) =
>> > txtValue
>> >
>> >        SqlConn.ConnectionString =
>> > ConfigurationSettings.AppSettings("ConnectionString")
>> >        dgMassUpdate.EditItemIndex = -1
>> >
>> >        dgTemp.DataSource = dsMassUpdate
>> >        dgTemp.DataSource = CreateDataSource(ddlField, txtValue)
>> >
>> >    End Sub
>> >
>> >    Function CreateDataSource(ByVal ddlField As String, ByVal
>> > txtValue
>> > As String) As ICollection
>> >        Dim table As New DataTable
>> >        Dim tr As DataRow
>> >        Dim td As DataColumn
>> >        Dim newRow As DataRow
>> >        newRow = table.NewRow()
>> >
>> >        table.Columns.Add(New DataColumn(ddlField, GetType(String)))
>> >        table.Columns.Add(New DataColumn(txtValue, GetType(String)))
>> >
>> >        Dim dv As New DataView(table)
>> >        Return dv
>> >    End Function
>> >
>> >
>> > RobinS wrote:
>> >> No, you're asking too broad a question. It's like someone
>> >> posted a question "Tell me about Windows Forms". Or "Tell me
>> >> about ADO.Net". Well, there are books of over a thousand
>> >> pages, how do you answer that in a newsgroup? Go buy a book.
>> >>
>> >> This is a more specific question. Are you adding a row
>> >> to the 2nd grid before putting the values in? How are you
>> >> putting the values in / adding the information to the grid?
>> >> Post that code, and we can help you with it.
>> >>
>> >> Robin S.
>> >> ----------------------------------------
>> >> <shoo***@gmail.com> wrote in message
>> >> news:1165863972.268566.301470@16g2000cwy.googlegroups.com...
>> >> > Moreso, I think his response is saying I'm asking too specific a
>> >> > question.  I've actually done what you've described there, but
>> >> > the
>> >> > problem with that is once the user tries to add another item, it
>> >> > replaces the first value added to the 2nd grid.
>> >> >
>> >> > RobinS wrote:
>> >> >> How many times are you going to re-post this? Cor's response
>> >> >> means this: You are asking too broad a question.
>> >> >>
>> >> >> If the first control has only one value, use a combobox.
>> >> >> Bind it to your tblInvoiceData. Put a textbox next to it.
>> >> >> Put a button next to that. Add an event handler to the
>> >> >> button.
>> >> >>
>> >> >> Put a grid on the bottom. When they click on the <Add> button,
>> >> >> add a record to the grid.
>> >> >>
>> >> >> I think that's what you're going for.  Tackle the problems
>> >> >> one at a time. It seems like you're asking us to write the
>> >> >> whole thing for you. I'd do that for you, but you'll have
>> >> >> to send me a billing address... ;-)
>> >> >>
>> >> >> Robin S.
>> >> >> -----------------------------
>> >> >> <shoo***@gmail.com> wrote in message
>> >> >> news:1165857631.911727.4610@73g2000cwn.googlegroups.com...
>> >> >> >I don't care how one suggests I do it, but I've been searching
>> >> >> >for
>> >> >> >days
>> >> >> > on how to implement this concept.  I'm trying to use some
>> >> >> > kind
>> >> >> > of
>> >> >> > grid
>> >> >> > control (doesn't have to be a grid control, whatever works
>> >> >> > best)
>> >> >> > to
>> >> >> > display a dropdown menu of fields populated from table
>> >> >> > tblInvoiceData.
>> >> >> > This control also includes a textbox which the user can input
>> >> >> > a
>> >> >> > value.
>> >> >> > These two columns are side by side and not in a vertical
>> >> >> > layout.
>> >> >> >
>> >> >> > The user then clicks on the "add" button and that particular
>> >> >> > field
>> >> >> > and
>> >> >> > value displays in a grid (can be this original grid or
>> >> >> > another),
>> >> >> > BUT,
>> >> >> > does not update the database tables until the user finshes
>> >> >> > adding
>> >> >> > all
>> >> >> > their fields and then clicks on the UPDATE button, at which
>> >> >> > point
>> >> >> > updates tblInvoiceData for this particular clientID.
>> >> >> >
>> >> >> > HELP!!!
>> >> >> >
>> >> >
>> >
>
Author
12 Dec 2006 4:16 AM
shookim
That is correct.

RobinS wrote:
Show quoteHide quote
> Okay, let me try this again:
>
> dsMassUpdate is your actual dataset that is going to be updated?
>
> dgMassUpdate is a datagrid that shows the dataset dsMassUpdate?
> Or does it show a list of fields in dsMassUpdate? So they pick
> a field name and put the new value in the textbox and click a
> button and it adds it to dgTemp?
>
> Then when they're done, they apply all the updates to the
> dataset dsMassUpdate?
>
> Am I understanding your process yet?
>
> Robin S.
> -------------------------------------------
> <shoo***@gmail.com> wrote in message
> news:1165878860.214907.179770@l12g2000cwl.googlegroups.com...
> > my main dataset is dsMassUpdate which I fill early in early piece of
> > the code.  dgMassUpdate is the first datagrid, where I'm performing
> > the
> > update to the dataset.  dgTemp is the second datagrid which gets
> > populated with the field and value from the first datagrid.
> >
> > What I'm trying to do is allow the user to update each field with a
> > value they enter by updating the dataset and not the database.  When
> > the user is finally finished with selecting all the fields and adding
> > values for the field to be updated with, THEN they hit the UPDATE
> > button which updates the db.
> >
> > The purpose of the second datagrid was just to display what fields and
> > values the user selected and entered.  This data doesn't actually get
> > updated to the database immediately.
> >
> > RobinS wrote:
> >> Well, right off the bat, without completely understanding
> >> everything, this looks like an issue:
> >>
> >> dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddlField) =
> >> txtValue
> >>
> >> If you use Rows(0), it will always put it in the first row.
> >>
> >> Is dbMassUpdate your data grid that you are inserting their
> >> selection into? What is dgTemp?
> >>
> >> If anybody else out there has an opinion, please feel free to
> >> chime in!
> >>
> >> Robin S.
> >> -------------------------------
> >> <shoo***@gmail.com> wrote in message
> >> news:1165865542.533756.109940@j72g2000cwa.googlegroups.com...
> >> > oops, here it is again...
> >> >
> >> >    Sub dgMassUpdate_Insert(ByVal sender As Object, ByVal e As
> >> > DataGridCommandEventArgs)
> >> >        Dim cmdParam As SqlParameter
> >> >        Dim ddlField As String =
> >> > CType(e.Item.FindControl("ddlField"),
> >> > DropDownList).SelectedValue
> >> >        Dim txtValue As String =
> >> > CType(e.Item.FindControl("txtValue"),
> >> > TextBox).Text
> >> >
> >> >        dsMassUpdate = Session("dsMassUpdate")
> >> >        dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddlField) =
> >> > txtValue
> >> >
> >> >        SqlConn.ConnectionString =
> >> > ConfigurationSettings.AppSettings("ConnectionString")
> >> >        dgMassUpdate.EditItemIndex = -1
> >> >
> >> >        dgTemp.DataSource = dsMassUpdate
> >> >        dgTemp.DataSource = CreateDataSource(ddlField, txtValue)
> >> >
> >> >    End Sub
> >> >
> >> >    Function CreateDataSource(ByVal ddlField As String, ByVal
> >> > txtValue
> >> > As String) As ICollection
> >> >        Dim table As New DataTable
> >> >        Dim tr As DataRow
> >> >        Dim td As DataColumn
> >> >        Dim newRow As DataRow
> >> >        newRow = table.NewRow()
> >> >
> >> >        table.Columns.Add(New DataColumn(ddlField, GetType(String)))
> >> >        table.Columns.Add(New DataColumn(txtValue, GetType(String)))
> >> >
> >> >        Dim dv As New DataView(table)
> >> >        Return dv
> >> >    End Function
> >> >
> >> >
> >> > RobinS wrote:
> >> >> No, you're asking too broad a question. It's like someone
> >> >> posted a question "Tell me about Windows Forms". Or "Tell me
> >> >> about ADO.Net". Well, there are books of over a thousand
> >> >> pages, how do you answer that in a newsgroup? Go buy a book.
> >> >>
> >> >> This is a more specific question. Are you adding a row
> >> >> to the 2nd grid before putting the values in? How are you
> >> >> putting the values in / adding the information to the grid?
> >> >> Post that code, and we can help you with it.
> >> >>
> >> >> Robin S.
> >> >> ----------------------------------------
> >> >> <shoo***@gmail.com> wrote in message
> >> >> news:1165863972.268566.301470@16g2000cwy.googlegroups.com...
> >> >> > Moreso, I think his response is saying I'm asking too specific a
> >> >> > question.  I've actually done what you've described there, but
> >> >> > the
> >> >> > problem with that is once the user tries to add another item, it
> >> >> > replaces the first value added to the 2nd grid.
> >> >> >
> >> >> > RobinS wrote:
> >> >> >> How many times are you going to re-post this? Cor's response
> >> >> >> means this: You are asking too broad a question.
> >> >> >>
> >> >> >> If the first control has only one value, use a combobox.
> >> >> >> Bind it to your tblInvoiceData. Put a textbox next to it.
> >> >> >> Put a button next to that. Add an event handler to the
> >> >> >> button.
> >> >> >>
> >> >> >> Put a grid on the bottom. When they click on the <Add> button,
> >> >> >> add a record to the grid.
> >> >> >>
> >> >> >> I think that's what you're going for.  Tackle the problems
> >> >> >> one at a time. It seems like you're asking us to write the
> >> >> >> whole thing for you. I'd do that for you, but you'll have
> >> >> >> to send me a billing address... ;-)
> >> >> >>
> >> >> >> Robin S.
> >> >> >> -----------------------------
> >> >> >> <shoo***@gmail.com> wrote in message
> >> >> >> news:1165857631.911727.4610@73g2000cwn.googlegroups.com...
> >> >> >> >I don't care how one suggests I do it, but I've been searching
> >> >> >> >for
> >> >> >> >days
> >> >> >> > on how to implement this concept.  I'm trying to use some
> >> >> >> > kind
> >> >> >> > of
> >> >> >> > grid
> >> >> >> > control (doesn't have to be a grid control, whatever works
> >> >> >> > best)
> >> >> >> > to
> >> >> >> > display a dropdown menu of fields populated from table
> >> >> >> > tblInvoiceData.
> >> >> >> > This control also includes a textbox which the user can input
> >> >> >> > a
> >> >> >> > value.
> >> >> >> > These two columns are side by side and not in a vertical
> >> >> >> > layout.
> >> >> >> >
> >> >> >> > The user then clicks on the "add" button and that particular
> >> >> >> > field
> >> >> >> > and
> >> >> >> > value displays in a grid (can be this original grid or
> >> >> >> > another),
> >> >> >> > BUT,
> >> >> >> > does not update the database tables until the user finshes
> >> >> >> > adding
> >> >> >> > all
> >> >> >> > their fields and then clicks on the UPDATE button, at which
> >> >> >> > point
> >> >> >> > updates tblInvoiceData for this particular clientID.
> >> >> >> >
> >> >> >> > HELP!!!
> >> >> >> >
> >> >> >
> >> >
> >
Author
12 Dec 2006 4:46 AM
shookim
Yes, dgMassUpdate binds the query that holds all the fields that are
populated in the dropdownlist.  dgMassUpdate doesn't actually list
anything.  The only thing dgMassUpdate does, event wise, is fire
dgMassUpdate_Insert().  And Yes, you are correct, that event then calls
CreateDataSource().  And then the update button does a update of all
the fields and values they've entered.  Would you like me to send you
the actual code, so you can see it?

Thanks, I appreciate the help!

RobinS wrote:
Show quoteHide quote
> Okay, let me try this again:
>
> dsMassUpdate is your actual dataset that is going to be updated?
>
> dgMassUpdate is a datagrid that shows the dataset dsMassUpdate?
> Or does it show a list of fields in dsMassUpdate? So they pick
> a field name and put the new value in the textbox and click a
> button and it adds it to dgTemp?
>
> Then when they're done, they apply all the updates to the
> dataset dsMassUpdate?
>
> Am I understanding your process yet?
>
> Robin S.
> -------------------------------------------
> <shoo***@gmail.com> wrote in message
> news:1165878860.214907.179770@l12g2000cwl.googlegroups.com...
> > my main dataset is dsMassUpdate which I fill early in early piece of
> > the code.  dgMassUpdate is the first datagrid, where I'm performing
> > the
> > update to the dataset.  dgTemp is the second datagrid which gets
> > populated with the field and value from the first datagrid.
> >
> > What I'm trying to do is allow the user to update each field with a
> > value they enter by updating the dataset and not the database.  When
> > the user is finally finished with selecting all the fields and adding
> > values for the field to be updated with, THEN they hit the UPDATE
> > button which updates the db.
> >
> > The purpose of the second datagrid was just to display what fields and
> > values the user selected and entered.  This data doesn't actually get
> > updated to the database immediately.
> >
> > RobinS wrote:
> >> Well, right off the bat, without completely understanding
> >> everything, this looks like an issue:
> >>
> >> dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddlField) =
> >> txtValue
> >>
> >> If you use Rows(0), it will always put it in the first row.
> >>
> >> Is dbMassUpdate your data grid that you are inserting their
> >> selection into? What is dgTemp?
> >>
> >> If anybody else out there has an opinion, please feel free to
> >> chime in!
> >>
> >> Robin S.
> >> -------------------------------
> >> <shoo***@gmail.com> wrote in message
> >> news:1165865542.533756.109940@j72g2000cwa.googlegroups.com...
> >> > oops, here it is again...
> >> >
> >> >    Sub dgMassUpdate_Insert(ByVal sender As Object, ByVal e As
> >> > DataGridCommandEventArgs)
> >> >        Dim cmdParam As SqlParameter
> >> >        Dim ddlField As String =
> >> > CType(e.Item.FindControl("ddlField"),
> >> > DropDownList).SelectedValue
> >> >        Dim txtValue As String =
> >> > CType(e.Item.FindControl("txtValue"),
> >> > TextBox).Text
> >> >
> >> >        dsMassUpdate = Session("dsMassUpdate")
> >> >        dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddlField) =
> >> > txtValue
> >> >
> >> >        SqlConn.ConnectionString =
> >> > ConfigurationSettings.AppSettings("ConnectionString")
> >> >        dgMassUpdate.EditItemIndex = -1
> >> >
> >> >        dgTemp.DataSource = dsMassUpdate
> >> >        dgTemp.DataSource = CreateDataSource(ddlField, txtValue)
> >> >
> >> >    End Sub
> >> >
> >> >    Function CreateDataSource(ByVal ddlField As String, ByVal
> >> > txtValue
> >> > As String) As ICollection
> >> >        Dim table As New DataTable
> >> >        Dim tr As DataRow
> >> >        Dim td As DataColumn
> >> >        Dim newRow As DataRow
> >> >        newRow = table.NewRow()
> >> >
> >> >        table.Columns.Add(New DataColumn(ddlField, GetType(String)))
> >> >        table.Columns.Add(New DataColumn(txtValue, GetType(String)))
> >> >
> >> >        Dim dv As New DataView(table)
> >> >        Return dv
> >> >    End Function
> >> >
> >> >
> >> > RobinS wrote:
> >> >> No, you're asking too broad a question. It's like someone
> >> >> posted a question "Tell me about Windows Forms". Or "Tell me
> >> >> about ADO.Net". Well, there are books of over a thousand
> >> >> pages, how do you answer that in a newsgroup? Go buy a book.
> >> >>
> >> >> This is a more specific question. Are you adding a row
> >> >> to the 2nd grid before putting the values in? How are you
> >> >> putting the values in / adding the information to the grid?
> >> >> Post that code, and we can help you with it.
> >> >>
> >> >> Robin S.
> >> >> ----------------------------------------
> >> >> <shoo***@gmail.com> wrote in message
> >> >> news:1165863972.268566.301470@16g2000cwy.googlegroups.com...
> >> >> > Moreso, I think his response is saying I'm asking too specific a
> >> >> > question.  I've actually done what you've described there, but
> >> >> > the
> >> >> > problem with that is once the user tries to add another item, it
> >> >> > replaces the first value added to the 2nd grid.
> >> >> >
> >> >> > RobinS wrote:
> >> >> >> How many times are you going to re-post this? Cor's response
> >> >> >> means this: You are asking too broad a question.
> >> >> >>
> >> >> >> If the first control has only one value, use a combobox.
> >> >> >> Bind it to your tblInvoiceData. Put a textbox next to it.
> >> >> >> Put a button next to that. Add an event handler to the
> >> >> >> button.
> >> >> >>
> >> >> >> Put a grid on the bottom. When they click on the <Add> button,
> >> >> >> add a record to the grid.
> >> >> >>
> >> >> >> I think that's what you're going for.  Tackle the problems
> >> >> >> one at a time. It seems like you're asking us to write the
> >> >> >> whole thing for you. I'd do that for you, but you'll have
> >> >> >> to send me a billing address... ;-)
> >> >> >>
> >> >> >> Robin S.
> >> >> >> -----------------------------
> >> >> >> <shoo***@gmail.com> wrote in message
> >> >> >> news:1165857631.911727.4610@73g2000cwn.googlegroups.com...
> >> >> >> >I don't care how one suggests I do it, but I've been searching
> >> >> >> >for
> >> >> >> >days
> >> >> >> > on how to implement this concept.  I'm trying to use some
> >> >> >> > kind
> >> >> >> > of
> >> >> >> > grid
> >> >> >> > control (doesn't have to be a grid control, whatever works
> >> >> >> > best)
> >> >> >> > to
> >> >> >> > display a dropdown menu of fields populated from table
> >> >> >> > tblInvoiceData.
> >> >> >> > This control also includes a textbox which the user can input
> >> >> >> > a
> >> >> >> > value.
> >> >> >> > These two columns are side by side and not in a vertical
> >> >> >> > layout.
> >> >> >> >
> >> >> >> > The user then clicks on the "add" button and that particular
> >> >> >> > field
> >> >> >> > and
> >> >> >> > value displays in a grid (can be this original grid or
> >> >> >> > another),
> >> >> >> > BUT,
> >> >> >> > does not update the database tables until the user finshes
> >> >> >> > adding
> >> >> >> > all
> >> >> >> > their fields and then clicks on the UPDATE button, at which
> >> >> >> > point
> >> >> >> > updates tblInvoiceData for this particular clientID.
> >> >> >> >
> >> >> >> > HELP!!!
> >> >> >> >
> >> >> >
> >> >
> >
Author
11 Dec 2006 8:53 PM
shookim
Sub dgMassUpdate_Insert(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
        Dim cmdParam As SqlParameter
        Dim ddlField As String = CType(e.Item.FindControl("ddlField"),
DropDownList).SelectedValue
        Dim txtValue As String = CType(e.Item.FindControl("txtValue"),
TextBox).Text

        dsMassUpdate = Session("dsMassUpdate")
        dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddlField) =
txtValue

        SqlConn.ConnectionString =
ConfigurationSettings.AppSettings("ConnectionString")

        dgTemp.DataSource = CreateDataSource(ddlField, txtValue)

    End Sub

    Function CreateDataSource(ByVal ddlField As String, ByVal txtValue
As String) As ICollection
        Dim table As New DataTable
        Dim tr As DataRow
        Dim td As DataColumn
        Dim newRow As DataRow
        newRow = table.NewRow()

        table.Columns.Add(New DataColumn(ddlField, GetType(String)))
        table.Columns.Add(New DataColumn(txtValue, GetType(String)))

        Dim dv As New DataView(table)
        Return dv
    End Function