!gridview insert!?

!gridview insert!?

am 18.01.2008 07:17:09 von merrittr

I have a simple wizard generated gridview , and i seem to be unable to
grasp the intracacies
to add a insert row.

I thought the form object would work to insert a row (currently the db
is empty)
is the fact that all my fields are set up as bound the issue?????
WTF I would think this should be easy since generating the edit/select/
selete
part was easy



DataSourceID="SqlDataSource1">

Agency_ID:
Text='<%# Bind("Agency_ID") %>'>


Asset_Tag:


Serial_Number:
Text='<%# Bind("Serial_Number") %>'>


..
..
..

AllowSorting="True"
AutoGenerateColumns="False" BackColor="White"
BorderColor="#999999" BorderStyle="None"
BorderWidth="1px" CellPadding="3" DataKeyNames="Asset_Tag"
DataSourceID="SqlDataSource1"
ShowFooter="True" GridLines="Vertical" >


ShowSelectButton="True" />
SortExpression="Agency_ID" />
ReadOnly="True" SortExpression="Asset_Tag" />
SortExpression="Serial_Number" />
SortExpression="Type" />
SortExpression="SubType" />
SortExpression="Mfg" />
SortExpression="Model" />
SortExpression="Description" />
SortExpression="Purchase_Date" />
SortExpression="Purchase_Cost" />
HeaderText="Acquisition_Type" SortExpression="Acquisition_Type" />
SortExpression="Disposal_Date" />
HeaderText="Disposal_Reason" SortExpression="Disposal_Reason" />
SortExpression="CPU" />
SortExpression="MIPS_or_Mhz" />
SortExpression="Capacity" />
SortExpression="Asset_ID" />
HeaderText="Warranty_End_Date" SortExpression="Warranty_End_Date" />
HeaderText="Maintenance_End_Date"
SortExpression="Maintenance_End_Date" />
HeaderText="Maintenance_Cost" SortExpression="Maintenance_Cost" />
SortExpression="Asset_Name" />
SortExpression="OS_Version" />
SortExpression="Org" />
HeaderText="Physical_Address" SortExpression="Physical_Address" />
SortExpression="City" />
SortExpression="Notes" />


ForeColor="White" />
HorizontalAlign="Center" />


RE: !gridview insert!?

am 18.01.2008 15:40:03 von jignesh

GridView by default will now alllow you to insert new records.
you will need to activate footer section, convert footer into template so
that you can place few textboxes and button.

Once done you can write code on button click event to read data from footer
row
eg. GridView1.FooterRow.FindControl("TextBox1") as TextBox;

Need more help feel free to mail me.
Regards
JIGNESH


"merrittr" wrote:

> I have a simple wizard generated gridview , and i seem to be unable to
> grasp the intracacies
> to add a insert row.
>
> I thought the form object would work to insert a row (currently the db
> is empty)
> is the fact that all my fields are set up as bound the issue?????
> WTF I would think this should be easy since generating the edit/select/
> selete
> part was easy
>
>
>
> > DataSourceID="SqlDataSource1">
>
> Agency_ID:
> > Text='<%# Bind("Agency_ID") %>'>
>


> Asset_Tag:
>

> Serial_Number:
> > Text='<%# Bind("Serial_Number") %>'>
>


> ..
> ..
> ..
>
> > AllowSorting="True"
> AutoGenerateColumns="False" BackColor="White"
> BorderColor="#999999" BorderStyle="None"
> BorderWidth="1px" CellPadding="3" DataKeyNames="Asset_Tag"
> DataSourceID="SqlDataSource1"
> ShowFooter="True" GridLines="Vertical" >
>
>
> > ShowSelectButton="True" />
> > SortExpression="Agency_ID" />
> > ReadOnly="True" SortExpression="Asset_Tag" />
> > SortExpression="Serial_Number" />
> > SortExpression="Type" />
> > SortExpression="SubType" />
> > SortExpression="Mfg" />
> > SortExpression="Model" />
> > SortExpression="Description" />
> > SortExpression="Purchase_Date" />
> > SortExpression="Purchase_Cost" />
> > HeaderText="Acquisition_Type" SortExpression="Acquisition_Type" />
> > SortExpression="Disposal_Date" />
> > HeaderText="Disposal_Reason" SortExpression="Disposal_Reason" />
> > SortExpression="CPU" />
> > SortExpression="MIPS_or_Mhz" />
> > SortExpression="Capacity" />
> > SortExpression="Asset_ID" />
> > HeaderText="Warranty_End_Date" SortExpression="Warranty_End_Date" />
> > HeaderText="Maintenance_End_Date"
> SortExpression="Maintenance_End_Date" />
> > HeaderText="Maintenance_Cost" SortExpression="Maintenance_Cost" />
> > SortExpression="Asset_Name" />
> > SortExpression="OS_Version" />
> > SortExpression="Org" />
> > HeaderText="Physical_Address" SortExpression="Physical_Address" />
> > SortExpression="City" />
> > SortExpression="Notes" />
>

>
> > ForeColor="White" />
> > HorizontalAlign="Center" />
>
>
>

>