IT Community - Software Programming, Web Development and Technical Support

Properties of Anthem DataGrid

This is a discussion on Properties of Anthem DataGrid within the ASP and ASP.NET Programming forums, part of the Web Development category; Hi All, Some Properties of Anthem DataGrid CallBackCancelledFunction [get, set] Gets or sets the javascript function to execute on the ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > ASP and ASP.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 08-30-2007, 07:51 AM
shaalini shaalini is offline
D-Web Analyst
 
Join Date: Apr 2007
Posts: 342
shaalini is on a distinguished road
Default Properties of Anthem DataGrid

Hi All,
Some Properties of Anthem DataGrid
CallBackCancelledFunction [get, set]

Gets or sets the javascript function to execute on the client if the callback is cancelled. See PreCallBackFunction.

UpdateAfterCallBack [get, set]
Gets or sets a value which indicates whether the control should be updated after the current callback. Also see AutoUpdateAfterCallBack.

AutoUpdateAfterCallBack [get, set]
Gets or sets a value indicating whether the control should be updated after each callback. Also see UpdateAfterCallBack.

PostCallBackFunction [get, set]
Gets or sets the javascript function to execute on the client after the callback response is received.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-30-2007, 07:56 AM
shaalini shaalini is offline
D-Web Analyst
 
Join Date: Apr 2007
Posts: 342
shaalini is on a distinguished road
Default How to Edit,Delete GridView without postback using anthem

Hi
Edit,Delete GridView without postback using anthem

<%@ Page Language="C#" MasterPageFile="~/Sample.master" %>

<%@ Register Assembly="Anthem" Namespace="Anthem" TagPrefix="anthem" %>
<%@ Import Namespace="System.Data" %>

<script runat="server">

void resetButton_Click(object sender, EventArgs e)
{
DataSource.RemoveDataTable();
gridView.DataBind();
gridView.UpdateAfterCallBack = true;
}

protected void filterButton_Click(object sender, EventArgs e)
{
gridView.UpdateAfterCallBack = true;
}

protected void gridView_SelectedIndexChanged(object sender, EventArgs e)
{
Anthem.GridView gv = sender as Anthem.GridView;
string id = gv.SelectedRow.Cells[0].Text;
Anthem.Manager.AddScriptForClientSideEval(
string.Format(
"alert('You selected the record with an ID of {0}!')",
id
)
);
}

protected void DetailsView1_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
{
gridView.DataBind();
}

protected void DetailsView1_ItemDeleted(object sender, DetailsViewDeletedEventArgs e)
{
gridView.DataBind();
}

</script>

<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="ContentPlaceHolder">

<script type="text/javascript">
function preDelete() {
return confirm('Are you sure?');
}
</script>

<asp:ObjectDataSource ID="DataSource1" runat="server" TypeName="DataSource"
SelectMethod="Select" UpdateMethod="Update" DeleteMethod="Delete" FilterExpression="{0}">
<FilterParameters>
<asp:ControlParameter ControlID="filterTextBox" />
</FilterParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="DetailSource1" runat="server" TypeName="DetailSource"
SelectMethod="Select" UpdateMethod="Update" DeleteMethod="Delete">
<SelectParameters>
<asp:ControlParameter ControlID="gridView" Name="id" PropertyName="SelectedValue" Type="int32" />
</SelectParameters>
</asp:ObjectDataSource>
<anthem:GridView ID="gridView" runat="server" AutoGenerateColumns="False" DataSourceID="DataSource1"
DataKeyNames="id" AllowSorting="True" AllowPaging="True" PageSize="5" CellPadding="4"
ForeColor="#333333" GridLines="None" OnSelectedIndexChanged="gridView_SelectedIndexChan ged" Width="300px">
<Columns>
<asp:BoundField DataField="id" HeaderText="ID" SortExpression="id" ReadOnly="True" />
<asp:BoundField DataField="a" HeaderText="A" SortExpression="a" />
<asp:BoundField DataField="b" HeaderText="B" SortExpression="b" />
<asp:CheckBoxField DataField="c" HeaderText="C" SortExpression="c" />
<asp:TemplateField ShowHeader="False">
<edititemtemplate>
<asp:LinkButton runat="server" Text="Update" CommandName="Update" CausesValidation="True" id="LinkButton1" />
<asp:LinkButton runat="server" Text="Cancel" CommandName="Cancel" CausesValidation="False" id="LinkButton2" />

</edititemtemplate>
<itemtemplate>
<asp:LinkButton runat="server" Text="Edit" CommandName="Edit" CausesValidation="False" id="LinkButton4" />
<anthem:LinkButton runat="server" Text="Delete" CommandName="Delete" CausesValidation="False" id="LinkButton3"
PreCallBackFunction="preDelete" />

</itemtemplate>
</asp:TemplateField>
<asp:CommandField ShowSelectButton="True" />
</Columns>
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#EFF3FB" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
<EditRowStyle BackColor="#2461BF" />
</anthem:GridView>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<anthemetailsView ID="DetailsView1" runat="server"
AutoGenerateDeleteButton="True"
AutoGenerateEditButton="True"
DataKeyNames="id"
DataSourceID="DetailSource1"
HeaderText="DetailsView"
OnItemUpdated="DetailsView1_ItemUpdated"
OnItemDeleted="DetailsView1_ItemDeleted"
Width="300px">
<HeaderStyle BackColor="#2461BF" Font-Bold="True" ForeColor="White" />
<CommandRowStyle BackColor="#2461BF" ForeColor="White" />
<FieldHeaderStyle BackColor="#507CD1" />
<RowStyle BackColor="#EFF3FB" />
</anthemetailsView>
</td>
<td valign="top">
<anthem:FormView ID="FormView1" runat="server"
DataKeyNames="id"
DataSourceID="DetailSource1"
HeaderText="FormView"
Width="300px">
<RowStyle BackColor="#EFF3FB" />
<ItemTemplate>
<table>
<tr>
<td><b>ID:</b></td>
<td><%# Eval("id") %></td>
</tr>
<tr>
<td><b>E:</b></td>
<td><%# Eval("e") %></td>
</tr>
<tr>
<td><b>F:</b></td>
<td><%# Eval("f") %></td>
</tr>
</table>
</ItemTemplate>
<HeaderStyle BackColor="#2461BF" Font-Bold="True" ForeColor="White" />
</anthem:FormView>
</td>
</tr>
</table>
<div>
<p>
Enter an expression to filter the data (something like <code>id &lt;= 5</code> or
<code>not c</code>):</p>
<asp:TextBox ID="filterTextBox" runat="server" />
<anthem:Button ID="filterButton" runat="server" Text="Filter" OnClick="filterButton_Click" />
</div>
<div>
<p>
Click the Reset button to restore the data after updating/deleting.</p>
<anthem:Button ID="resetButton" runat="server" Text="Reset" OnClick="resetButton_Click" />
</div>
</asp:Content>
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-30-2007, 08:03 AM
shaalini shaalini is offline
D-Web Analyst
 
Join Date: Apr 2007
Posts: 342
shaalini is on a distinguished road
Default Set the control focus after postback in updatepanel

Hi all
When i have textbox and dropdownlist to focus the next control we use the tab index to focus the next control but when there is postback the focus starts from first.To focus the next control even after the postback

System.Web.UI.ScriptManager.GetCurrent(this).SetFo cus(this.YourControl);
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-30-2007, 08:09 AM
nnraja nnraja is offline
D-Web Programmer
 
Join Date: May 2007
Posts: 94
nnraja is on a distinguished road
Default Focus the control after postback

hi shaalini
Can u say how to focus the control in VB
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 08-30-2007, 08:12 AM
shaalini shaalini is offline
D-Web Analyst
 
Join Date: Apr 2007
Posts: 342
shaalini is on a distinguished road
Default Focus the control after postback

Hi raja
In VB you can use the following code

System.Web.UI.ScriptManager.GetCurrent(Me).SetFocu s(Me.YourControl)
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
List of EXIF metadata properties item name and its proprety ID values oxygen C# Programming 1 12-24-2007 02:30 AM
How to use the edit delete function without postback in datagrid using anthem kingmaker ASP and ASP.NET Programming 1 08-29-2007 11:59 PM
How to change the checkBox properties, which is inside nested Repeater/Grid kingmaker C# Programming 2 08-10-2007 12:28 AM
How we know browser properties? devarajan.v PHP Programming 1 07-27-2007 03:36 AM
XML parsing properties and Methods in Javascript Jeyaseelansarc PHP Programming 0 05-08-2007 03:16 AM


All times are GMT -7. The time now is 02:27 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0