Hello everybody.
This may be a bit of a silly question but I can't seem to get my SQLDataSource to update. I have a feeling that I must set one of the properties of the webdatagrid to something. The problem is that I make changes to the grid but nothing ever gets committed and my SqlDataSource's OnUpdating handler never gets called.
Any help is appreciated, here is the WebDataGrid node:
<ig:WebDataGrid ID="WebDataGrid1" runat="server" DataSourceID="SqlDataSource1"
Height="350px" Width="850px" AutoGenerateColumns="False" DataKeyFields="Job"
Style="position:absolute; left:20px; top:180px">
<Columns>
<ig:BoundDataField Key="Job" Header-Text="Job #" Width="100">
<Header Text="Job #"></Header>
</ig:BoundDataField>
<ig:BoundDataField Key="Client" Header-Text="Client" Width="150">
<Header Text="Client"></Header>
<ig:BoundDataField Key="Descr" Header-Text="Description" Width="150">
<Header Text="Description"></Header>
<ig:BoundDataField Key="Sun" Header-Text="Sun">
<Header Text="Sun"></Header>
<ig:BoundDataField Key="Mon" Header-Text="Mon">
<Header Text="Mon"></Header>
<ig:BoundDataField Key="Tue" Header-Text="Tue">
<Header Text="Tue"></Header>
<ig:BoundDataField Key="Wed" Header-Text="Wed">
<Header Text="Wed"></Header>
<ig:BoundDataField Key="Thu" Header-Text="Thu">
<Header Text="Thu"></Header>
<ig:BoundDataField Key="Fri" Header-Text="Fri">
<Header Text="Fri"></Header>
<ig:BoundDataField Key="Sat" Header-Text="Sat">
<Header Text="Sat"></Header>
<ig:BoundDataField Key="Total" Header-Text="Total">
<Header Text="Total"></Header>
</Columns>
<Behaviors>
<ig:EditingCore>
<ig:CellEditing>
<ColumnSettings>
<ig:EditingColumnSetting ColumnKey="Job" EditorID="JobSelector" />
<ig:EditingColumnSetting ColumnKey="Client" ReadOnly="true" />
<ig:EditingColumnSetting ColumnKey="Descr" ReadOnly="true" />
<ig:EditingColumnSetting ColumnKey="Total" ReadOnly="true" />
</ColumnSettings>
<EditModeActions MouseClick="Single" />
<CellEditingClientEvents ExitedEditMode="EvaluateTotals" />
</ig:CellEditing>
</Behaviors>
</ig:EditingCore>
<ig:SummaryRow FormatString="{1}" ShowSummariesButtons="False"
EmptyFooterText="">
<ColumnSummaries>
<ig:ColumnSummaryInfo ColumnKey="Sun">
<Summaries>
<ig:Summary SummaryType="Sum" />
</Summaries>
</ig:ColumnSummaryInfo>
<ig:ColumnSummaryInfo ColumnKey="Mon">
<ig:ColumnSummaryInfo ColumnKey="Tue">
<ig:ColumnSummaryInfo ColumnKey="Wed">
<ig:ColumnSummaryInfo ColumnKey="Thu">
<ig:ColumnSummaryInfo ColumnKey="Fri">
<ig:ColumnSummaryInfo ColumnKey="Sat">
<ig:ColumnSummaryInfo ColumnKey="Total">
</ColumnSummaries>
</ig:SummaryRow>
</ig:WebDataGrid>
Hi jathyal,
This should be working since you do have AutoCrud set to true on the EditingCore and you do have DataKeyFields set for the grid. Are you sure that you're posting back to actually make the udpate? Is your sql source set up for updates?
regards,David Young
How do I make sure that I'm posting back to make the update? isn't it supposed to automatically update on postback if AutoCRUD is set to true.
Yes, I'm pretty sure the source is set up for updates, but what I've noticed is that the updating handler never fires. This is what the SqlDataSource looks like:
<
="select pjt_entity as Job, DET.user2 as Client, DET.user1 as Descr,
day1_hr1 Sun, day2_hr1 Mon, day3_hr1 Tue, day4_hr1 Wed, day5_hr1 Thu, day6_hr1 Fri, day7_hr1 Sat,
DET.total_hrs Total
from maapp.dbo.pjlabdet DET, maapp.dbo.pjlabhdr HDR
where DET.docnbr = @DocNBR
and DET.docnbr = HDR.docnbr"
="SqlDataSource1_Deleting">
>
/>
</
Please advise.
Thanks