e.Item.Attributes.Add("onclick","javascript:__doPostBack('myClick'," + e.Item.ItemIndex + ");" );
It performs server side an postback, which i can get the information from the selected row !
But today, when i use this, sometimes an alert window occures in IE. This site could not be displayed. Any idea ???
I'm sure, something with radajaxpanel and __doPostPack(...) makes some problem.
protected void TeilnehmerTable_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if( (e.Item.ItemType == ListItemType.Item) ||
(e.Item.ItemType ==
ListItemType.AlternatingItem) ||
(e.Item.ItemType ==
ListItemType.SelectedItem) )
{
e.Item.Attributes.Add(
"onmouseover","this.style.cursor='hand'");
e.Item.Attributes.Add(
"onclick","javascript:__doPostBack('myClick'," + e.Item.ItemIndex + ");" );
}
16. From the Smart Tag of the RadAjaxServiceManager (what a mouthful that is!), select the Configure
Ajax Service Manager Link. In the WebServiceReference Collection Editor dialog, click the Add button.
Type in the Path below and click OK:
How do I do this using the RadAjaxManager? How do I get the Javascipt generated to call my webservice.
Please update the learning guide for the AJAX controls.
| <telerik:RadGrid ID="rgFiles" runat="server" |
| Skin="Office2007" |
| AllowAutomaticDeletes="false" |
| meta:resourcekey="radGrid" |
| AllowAutomaticInserts="false" |
| AllowAutomaticUpdates="false" |
| AllowMultiRowEdit="false" |
| AllowMultiRowSelection="false" |
| AllowSorting="true" |
| AllowPaging="true" |
| PageSize="10" |
| OnNeedDataSource="rgFiles_NeedDataSource" |
| OnDeleteCommand="rgFiles_Delete" |
| OnItemCommand="rgFiles_ItemCommand" |
| OnDetailTableDataBind="rgFiles_DetailTableDataBind" |
| AutoGenerateColumns="false"> |
| <PagerStyle Mode="NumericPages" /> |
| <ClientSettings> |
| <Selecting AllowRowSelect="true" /> |
| </ClientSettings> |
| <MasterTableView DataKeyNames="Id" HierarchyLoadMode="Client" EditMode="InPlace"> |
| <Columns> |
| <telerik:GridButtonColumn |
| ButtonType="ImageButton" |
| UniqueName="Download" |
| CommandName="ItemCommand" |
| ImageUrl="~/Img/Type.gif" |
| CommandArgument="download"> |
| </telerik:GridButtonColumn> |
| <telerik:GridBoundColumn meta:resourcekey="colFilename" ReadOnly="true" |
| UniqueName="Filename" DataField="Filename" > |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn ReadOnly="true" |
| Visible="false" UniqueName="Mimetype" DataField="Mimetype" > |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn meta:resourcekey="colSize" ReadOnly="true" |
| UniqueName="Size" DataField="Size" > |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn meta:resourcekey="colCreateDate" ReadOnly="true" |
| UniqueName="CreationDate" DataField="CreationDate" > |
| </telerik:GridBoundColumn> |
| <telerik:GridButtonColumn |
| meta:resourcekey="colDelete" |
| UniqueName="DeleteColumn" |
| CommandName="Delete" |
| ButtonType="ImageButton" |
| ImageurL="~/Img/delete.gif" |
| Display="false"> |
| </telerik:GridButtonColumn> |
| </Columns> |
| <DetailTables> |
| <telerik:GridTableView Name="Keywords" |
| EditMode="InPlace" |
| ShowFooter="False" |
| meta:resourcekey="detailtable"> |
| <columns> |
| <telerik:GridTemplateColumn UniqueName="colKeywords"> |
| <HeaderStyle Width="200px"></HeaderStyle> |
| <HeaderTemplate> |
| <asp:Label meta:resourcekey="lblHeadKeywords" ID="lblHeadKeywords" runat="server" ></asp:Label> |
| </HeaderTemplate> |
| <ItemTemplate> |
| <p> |
| <asp:Label meta:resourcekey="lblKeywords" ID="lblKeywords" |
| runat="server" Text='<%# Eval("SearchField") %>' Width="100%"> |
| </asp:Label> |
| </p> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <p> |
| <asp:TextBox ID="txtKeywords" runat="server" Text='<%# Eval("SearchField") %>' TextMode="MultiLine" > |
| </asp:TextBox> |
| </p> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridEditCommandColumn FooterText="EditCommand footer" |
| UniqueName="EditCommandColumn" HeaderText="Edit Command Column"> |
| </telerik:GridEditCommandColumn> |
| </columns> |
| </telerik:GridTableView> |
| </DetailTables> |
| </MasterTableView> |
| </telerik:RadGrid> |
| protected void rgFiles_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) |
| { |
| if (this.files == null) |
| { |
| if (this.NeedDataSource != null) |
| { |
| AddFileEventArgs afea = new AddFileEventArgs(); |
| afea.FileOwnerId = this.OwnerId; |
| this.NeedDataSource(this, afea); |
| this.files = afea.Files; |
| } |
| } |
| if (sender is RadGrid) |
| { |
| (sender as RadGrid).DataSource = this.files; |
| } |
| } |
| protected void rgFiles_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) |
| { |
| ICollection<IPortalFile> coll = null; |
| if (rgFiles.DataSource != null) |
| { |
| coll = rgFiles.DataSource as ICollection<IPortalFile>; |
| } |
| if (coll == null && this.files != null) |
| { |
| coll = this.files; |
| } |
| if (coll == null) |
| return; |
| string id = (string) e.DetailTableView.ParentItem.GetDataKeyValue("Id"); |
| foreach (IPortalFile file in coll) |
| { |
| if (file.Id.Equals(id)) |
| { |
| e.DetailTableView.DataSource = new IPortalFile[]{ file }; |
| } |
| } |
| } |
| protected void OnPreRender(object sender, EventArgs e) |
| { |
| this.DataBind(); |
| if (this.enabled) |
| { |
| this.btnAddFile.CssClass = CSS_ENABLED; |
| this.rgFiles.Columns[this.rgFiles.Columns.Count - 1].Display = true; |
| } |
| else |
| { |
| this.btnAddFile.CssClass = CSS_DISABLED; |
| this.rgFiles.Columns[this.rgFiles.Columns.Count - 1].Display = false; |
| } |
| this.rgFiles.Rebind(); |
| } |
