My problem is that when I try to click the combobox within my Radgrid, it doesn't do anything.
<telerik:RadGrid ID="RadGrid" runat="server" DataSourceID="TestReleaseInformationSource" ShowStatusBar="true"
OnItemCommand="RadGridItemCommand" OnPreRender="RadGrid_PreRender" AllowAutomaticUpdates="true" EnableLinqExpressions="false"
AllowAutomaticDeletes="true" AllowPaging="true" AutoGenerateColumns="false" AllowFilteringByColumn="true">
<MasterTableView DataKeyNames="PrimaryKey">
<Columns>
<telerik:GridBoundColumn AllowFiltering="true" UniqueName="TeacherLastName" DataField="TeacherLastName" HeaderText="Last Name">
<FilterTemplate>
<telerik:RadComboBox ID="radComboBoxLastName" DataSourceID="TeacherLastNameDDL" DataTextField="TeacherLastName" DataValueField="TeacherLastName"
AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("TeacherLastName").CurrentFilterValue %>'
runat="server" OnClientSelectedIndexChanged="TeacherLastNameChanged">
<Items>
<telerik:RadComboBoxItem Text="All" Selected="true" />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function TeacherLastNameChanged(sender, args)
{
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
tableView.filter("TeacherLastName", args.get_item().get_value(), "EqualTo");
}
</script>
</telerik:RadScriptBlock>
</FilterTemplate>
</telerik:GridBoundColumn>
On prerender of the grid
protected void RadGrid_PreRender(object sender, EventArgs e)
{
if (RadGrid.EditItems.Count > 0)
{
GridNestedViewItem item = (GridNestedViewItem)RadGrid.MasterTableView.GetItems(GridItemType.NestedView)[Convert.ToInt32(RadGrid.EditIndexes[0])];
item.Visible = false;
}
if (RadGrid.MasterTableView.FilterExpression != string.Empty)
{
RefreshCombos();
}
}
protected void RefreshCombos()
{
TestReleaseInformationSource.SelectCommand = TestReleaseInformationSource.SelectCommand + " WHERE " + RadGrid.MasterTableView.FilterExpression.ToString();
RadGrid.MasterTableView.Rebind();
}
I've stared at this for hours and can not figure out what the problem is. Any thoughts would be appreciated. Will post more code if necessary.
A solution I have found is to set the RenderMode property of the combobox to native. I would still like a different workaround.
Try making the JS functions unique: http://www.telerik.com/support/kb/details/using-dynamic-unique-names-for-javascript-functions
I think that all of them override each other so only the last one is active so only that executes. Also, look for JS errors.
Also, try invoking the filtering from the client as shown here http://www.telerik.com/help/aspnet-ajax/grid-client-side-binding-adding-sort-filter-expressions.html.
The masterTableView object is best obtained via the get_masterTableView() method of the main grid object.
Related
I want to bind gridview on treenode click.code works fine without error but in UI nothing changes, but when I use same code on button click, Gridview binds data properly.
My apsx code is
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div style="overflow: scroll; height: 450px;">
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Always">
<ContentTemplate>
<asp:TreeView ID="Folder_Treeview" runat="server" ShowLines="true" LeafNodeStyle-CssClass="childnode"
Style="" ForeColor="Blue" SelectedNodeStyle-ForeColor="Green" OnSelectedNodeChanged="Folder_Treeview_SelectedItemChanged">
</asp:TreeView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<asp:GridView ID="GridView1" CssClass="grid" GridLines="None" ShowFooter="true" AllowPaging="true"
PageSize="5" AutoGenerateColumns="false" OnPageIndexChanging="GridView1_PageIndexChanging"
runat="server">
<Columns>
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<asp:Label ID="lblName" runat="server" Text='<%#Eval("Name")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="File Length">
<ItemTemplate>
<asp:Label ID="lblLen" runat="server" Text='<%#Eval("Length")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="File Extention">
<ItemTemplate>
<asp:Label ID="lblFileType" runat="server" Text='<%#Eval("Extension")%>'>
</asp:Label></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Creation Date & Time">
<ItemTemplate>
<asp:Label ID="lblDateTime" runat="server" Text='<%#Eval("CreationTime")%>'>
</asp:Label></ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<p>
<asp:Label Text="" ID="lblMsg" runat="server"></asp:Label></p>
CS Code:
protected void Folder_Treeview_SelectedItemChanged(object sender, EventArgs e)
{
TreeNode node = this.Folder_Treeview.SelectedNode;
SetFolderPath(node);
}
public void SetFolderPath(TreeNode node)
{
Session["ParentFolderId"] = node;
// System.IO.DirectoryInfo RootDir = new System.IO.DirectoryInfo(Server.MapPath("~/"));
string CurrNode = node.Text;
string separator = "\\";
Folder_Treeview.PathSeparator = Convert.ToChar(separator);
while (node.Parent != null)
{
CurrNode = node.Parent.Text + this.Folder_Treeview.PathSeparator + CurrNode;
node = node.Parent;
}
ViewState["Folder"] = CurrNode;
ViewState["FileType"] = "All";
GetFilesFromFolder();
}
private void GetFilesFromFolder()
{
// GET A LIST OF FILES FROM A SPECIFILED FOLDER.
DirectoryInfo objDir = new DirectoryInfo(Server.MapPath((string)ViewState["Folder"]));
FileInfo[] listfiles = objDir.GetFiles("*." + ((string)ViewState["FileType"] != "All" ?
ViewState["FileType"] : "*"));
if (listfiles.Length > 0)
{
// BIND THE LIST OF FILES (IF ANY) WITH GRIDVIEW.
GridView1.Visible = true;
GridView1.DataSource = listfiles;
GridView1.DataBind();
lblMsg.Text = listfiles.Length + " files found";
}
else
{
GridView1.Visible = false;
lblMsg.Text = "No files found";
}
}
OnSelectedNodeChanged method get called on node click, and all value sets properly but never get reflect.
Please help.
It's your update panel. The node event originates within the UpdatePanel so only the Update panel will get updated after postback. Keep in mind that the full Page lifecycle occurs, so the gridview does get databound, but only the content within the UpdatePanel will be refreshed.
Your options:
Add Folder_Treeview as a PostBack Trigger -or-
Get rid of the UpdatePanel altogether -or-
Move the Gridview inside the UpdatePanel ContentTemplate
Also a TreeView is one of several server controls that may not be compatible with an UpdatePanel:
The following ASP.NET controls are not compatible with partial-page updates, and are therefore not designed to work inside an UpdatePanel control:
TreeView control under several conditions. One is when callbacks are enabled that are not part of an asynchronous postback. Another is when you set styles directly as control properties instead of implicitly styling the control by using a reference to CSS styles. Another is when the EnableClientScript property is false (the default is true). Another is if you change the value of the EnableClientScript property between asynchronous postbacks. For more information, see TreeView Web Server Control Overview.
Menu control when you set styles directly as control properties instead of implicitly styling the control by using a reference to CSS styles. For more information, see Menu Control Overview.
FileUpload and HtmlInputFile controls when they are used to upload files as part of an asynchronous postback.
GridView and DetailsView controls when their EnableSortingAndPagingCallbacks property is set to true. The default is false.
Login, PasswordRecovery, ChangePassword, and CreateUserWizard controls whose contents have not been converted to editable templates.
The Substitution control.
I am trying to hide the Telerik RadGrid Edit column until the user clicks on the row the user wants to edit. Upon the click event I need the Edit hyperlink column set to Visible="true". I was hoping to set the column as Visible="false" by default, and then add a click event in my .cs page to alter the visibility property, but I cannot figure out how to target the edit column... Here is my code for the .aspx page.
<telerik:RadGrid ID="RG_POI" runat="server" OnPreRender="RG_POI_PreRender" OnItemDataBound="RG_POI_ItemDataBound" >
<MasterTableView EditMode="InPlace" >
<Columns>
<telerik:GridEditCommandColumn Visible="false"/>
</Columns>
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn1 column" UniqueName="EditCommandColumn1">
</EditColumn>
</EditFormSettings>
</MasterTableView>
You can do this via C# or JavaScript. If you use C#, you can remove the OnRowSelected="gridSelected" from the grid definition below; if you use JavaScript then remove the OnSelectedIndexChanged="rgTest_SelectedIndexChanged":
ASPX:
<telerik:RadGrid ID="RG_POI" ... OnSelectedIndexChanged="rgTest_SelectedIndexChanged">
<ClientSettings ... >
<ClientEvents OnGridCreated="gridCreated" OnRowSelected="gridSelected" />
</ClientSettings>
<MasterTableView ... >
<Columns>
<telerik:GridEditCommandColumn UniqueName="Edit" />
...
Option 1) C#:
protected void rgTest_SelectedIndexChanged(object sender, EventArgs e)
{
RG_POI.Columns[1].Visible = true;
}
Option 2) JavaScript:
function gridCreated(menu, args) {
var radGrid = $find('RG_POI');
var table = radGrid.get_masterTableView();
table.shideColumn(1);
}
function gridSelected(menu, args) {
var radGrid = $find('RG_POI');
var table = radGrid.get_masterTableView();
table.showColumn(1);
}
I have a code that contains an ASPxGridView and a ASPxCheckBox and Label within in like:
<dx:ASPxGridView ID="gvTableSearchHomes" runat="server" DataSourceID="XmlHomes" Width="341px"
CssClass="tableViewSearchGrid" ClientInstanceName="gvTableSearchHomes"
AutoGenerateColumns="False" EnableRowsCache="false" KeyFieldName="ID">
<%--<Columns>--%>
<%-- DXCOMMENT: Within ASPxGridView, add a column whose values will participate in filtering --%>
<%--<dx:GridViewDataTextColumn FieldName="Address">
<PropertiesTextEdit NullText="Search your home"></PropertiesTextEdit>
<Settings AllowAutoFilterTextInputTimer="True" AutoFilterCondition="Contains" />
</dx:GridViewDataTextColumn>
</Columns>--%>
<Templates>
<%--DXCOMMENT: Configure the grid's DataRow template in accordance with data source fields --%>
<DataRow>
<div class="gvItem">
<dx:ASPxCheckBox ID="ChkBookList" runat="server"></dx:ASPxCheckBox>
<dx:ASPxLabel ID="Address" runat="server" CssClass="address" Text='<%# Utils.ExtractFirstRow(Eval("Address")) %>' />
<%--<p><dx:ASPxLabel ID="Address2" runat="server" CssClass="address2" Text='<%# Utils.ExtractSecondRow(Eval("Address")) %>' /></p>
<p><dx:ASPxLabel ID="Price" runat="server" CssClass="price" Text='<%# Utils.GetPrice(Eval("Price")) %>' /></p>--%>
</div>
</DataRow>
</Templates>
<SettingsPager Visible="false" PageSize="1000" />
<Settings ShowVerticalScrollBar="True" ShowFilterRow="true" ShowColumnHeaders="false"/>
<SettingsBehavior AutoExpandAllGroups="true" AllowSelectSingleRowOnly="true" AllowSelectByRowClick="true"/>
<ClientSideEvents
Init="function(){ hr.TableViewLandscape_Adjust(); }"
EndCallback="function(){ hr.TableViewLandscape_Adjust(); }"
SelectionChanged="OnGvTableSearchHomesSelectedChanged" />
<Styles>
<SelectedRow ForeColor="White"></SelectedRow>
</Styles>
I am not able to access these cotnrols through C# code. Can anybody help me. Please
Check the documentation methods to find controls in different gridview templates.
e.g. ASPxGridView.FindRowTemplateControl Method
Source: http://developmentsolutionsjunction.blogspot.in/2011/11/find-controls-in-dataitemtemplate-of.html
//markup
<dx:ASPxGridView ID="grvTest" AutoGenerateColumns="False" runat="server" DataSourceID="SqlDataSource1"
OnHtmlRowPrepared="grvTest_HtmlRowPrepared" OnHtmlRowCreated="grvTest_HtmlRowCreated">
<Columns>
<dx:GridViewDataTextColumn Caption="RowID" Name="colRowID" VisibleIndex="0" Width="20px">
<DataItemTemplate>
<dx:ASPxLabel ID="lblRowID" runat="server" Text='Label'>
</dx:ASPxLabel>
</DataItemTemplate>
</dx:GridViewDataTextColumn>
//accessing template control in code-behind
protected void grvTest_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e)
{
if (e.RowType != GridViewRowType.Data) return;
ASPxLabel label = grvTest.FindRowCellTemplateControl(e.VisibleIndex, null,
"lblRowID") as ASPxLabel;
label.Text = (e.VisibleIndex + 1).ToString();
}
example code:
ASPxGridView grid = (ASPxGridView)sender;
ASPxPageControl myPages = grid.FindEditFormTemplateControl("CityEditTabs")
as ASPxPageControl;
References:
How can I write events for the controls used in my Grid templates
Some GridView code snippets to understand gridview concepts
Identify the VisibleIndex or RowHandle to get the control in particular template that you have created in your markup.
Hope above example will help you to solve your problem.
thanks I solved mi problem. I put this
Protected Sub GvEncuesta_HtmlRowCreated(sender As Object, e As ASPxGridViewTableRowEventArgs)
If (e.RowType <> GridViewRowType.Data) Then Return
Try
Dim cmbRespuesas As ASPxComboBox = GvEncuesta.FindRowCellTemplateControl(e.VisibleIndex, Nothing, "ASPxCmbRespuestas")
cmbRespuesas.IncrementalFilteringMode = IncrementalFilteringMode.Contains
cmbRespuesas.Visible = True
cmbRespuesas.DataSource = wcfCap.RetrieveRespuestaEncuestaxEstado(1)
cmbRespuesas.ValueField = "Cod_Respuesta"
cmbRespuesas.TextField = "Nombre_Respuesta"
cmbRespuesas.DataBindItems()
Catch ex As Exception
End Try
End Sub
I am working on a project using Telerik controls. I'm trying to figure out how to get the selected row index on an ItemTemplate button click event, like in the markup below:
<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True"
DataSourceID="cusGrid" GridLines="None" Skin="Default" AllowPaging="True" DataKeyValue="CustomerID"
PageSize="500" AllowMultiRowSelection="True" ShowStatusBar="true" >
<MasterTableView AutoGenerateColumns="False" DataKeyNames="CustomerID" DataSourceID="cusGrid">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<Columns>
<telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">
<ItemTemplate>
<asp:Button runat="server" Text="Select" OnClick="SelRecord" />
</ItemTemplate>
</telerik:GridTemplateColumn>
...
Normally with a GridView I would just do something like:
protected void SelRecord(object sender, EventArgs e)
{
var gRow = (GridViewRow)(sender as Control).Parent.Parent;
var key = string.Empty;
if (gRow != null) { key = gRow.Cells[0].Text; }
}
What is the equivalent with the Telerik control?
Use the CommandArgument, and use OnCommand instead of OnClick to get the row index:
<asp:Button ID="Button1" runat="server" CommandArgument='<%#Container.ItemIndex%>' OnCommand="Button1_Command" ... />
Code-behind:
protected void Button1_Command(object sender, CommandEventArgs e)
{
GridDataItem item = RadGrid1.Items[(int)e.CommandArgument];
}
You can use CommandName="" instead of OnClick.
Also add onitemdatabound="RadGrid1_ItemDataBound" to the main telerik:RadGrid tag.
Then in the code behind:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem dataItem = e.Item as GridDataItem;
int selectedRowIndex = dataItem.RowIndex;
}
}
Looking through the Telerik documentation, it looks like you want:
var gRow = ((sender as Button).NamingContainer as GridItem).Selected;
You didn't ask about this piece, but I think this code:
if (gRow != null) { key = gRow.Cells[0].Text; }
is asking for trouble.
Although markup and code-behind are always highly coupled, directly referencing individual cells is a code smell if you ask me. I'm guessing that you want to pull "Select" out of the ASP Button in your ItemTemplate.
Can you assign an ID to your Button, and call FindControl("buttonID") to get the data you need? That will help keep your code more maintainable and readable.
<telerik:GridTemplateColumn UniqueName="IndexRow" HeaderText="#">
<ItemTemplate>
<%#Container.ItemIndex + 1%>
</ItemTemplate>
</telerik:GridTemplateColumn>
something like this in Button click event should work
foreach (GridDataItem item in RadGrid1.SelectedItems)
{
GridDataItem item = (GridDataItem)RadGrid1.SelectedItems;
var key = string.Empty;
key = item.ItemIndex;
}
Here is what I am doing. I create two buttons in a header row of a gridview that i created. The buttons are +page and -page. When -page is hit I remove the paging and all the data goes down the page and -page disappears and +page is there.
Here comes my issue When I hit +page I must be double postbacking because one row of my data disappears. I will provide the code below. What can i do to fix this??
Dim bttnrempag As New Button
bttnrempag.ID = "bttnrempag"
bttnrempag.Text = " Paging"
bttnrempag.CssClass = "bttnMinEG"
bttnrempag.ValidationGroup = "alone"
bttnrempag.Attributes.Add("onclick", "return Paging('1')")
Dim bttnallowpag As New Button
bttnallowpag.ID = "bttnallowpag"
bttnallowpag.Text = " Paging"
bttnallowpag.ValidationGroup = "alone"
bttnallowpag.CssClass = "bttnAddEG"
bttnallowpag.Attributes.Add("onclick", "return Paging('0')")
---------------------How the buttons are added------------------------------------------
Dim row As New GridViewRow(-1, -1, DataControlRowType.Separator, DataControlRowState.Normal)
row.Cells.Add(cell)
cell.Controls.Add(bttnrempag) '36
cell.Controls.Add(bttnallowpag)
----------------------------------------------------------------------------------------
function Paging(remove) {
var gridView = $get('<%=Gridview1.ClientID %>');
var txt2 = $get('<%=TextBox2.ClientID %>');
if (remove == '1') {
txt2.value = '1';
__doPostBack('<%=UpdatePanel1.ClientID %>', '');
return false;
}
else {
txt2.value = '0';
__doPostBack('<%=UpdatePanel1.ClientID %>', '');
return false;
}
Edited
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate >
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" BackColor="White" BorderColor="#E7E7FF"
BorderStyle="None" BorderWidth="1px" CellPadding="3"
DataSourceID="SqlDataSource1" Font-Names="Comic Sans MS" Font-Size="XX-Small"
Caption = '<table border="" width="100%" cellpadding="3" cellspacing="0" bgcolor="#4A3C8C"><tr><td style = "font-size:X-large;font-family:Arial CE;color:White"><b>Ordering/Receiving Log</u></td></tr></table>'
Font-Bold="True" PageSize="15" >
<RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
<Columns>
Bound Data
</Columns>
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
<EmptyDataTemplate>
<head>
<meta http-equiv="refresh" content="5;URL=/Corporate_newpo/ReceivingLog.aspx?">
</head>
<script type="text/javascript" >
var count = 6;
var counter = setInterval("timer()", 1000); //1000 will run it every 1 second
function timer() {
count = count - 1;
if (count <= 0) {
clearInterval(counter);
//counter ended, do something here
return;
}
$get("timer").innerHTML = "The Table will Reload in " + count + " secs";
}
</script>
<asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="Large"
ForeColor="#993333" Text="No Data was Found for the Selected Filter"></asp:Label><br /><br />
<span id="timer" style="font-size:medium;color:blue"></span>
</EmptyDataTemplate>
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
<AlternatingRowStyle BackColor="#F7F7F7" />
<PagerTemplate>
<small 12px""="" style="font-size:xx-small; padding-right">Go To Page</small>
<asp:DropDownList ID="ddlPageSelector" runat="server" AutoPostBack="true"
Font-Size="XX-Small" Height="19px" Width="36px">
</asp:DropDownList>
<asp:ImageButton ID="btnFirst" runat="server" CommandArgument="First"
CommandName="Page" SkinID="pagefirst" />
<asp:ImageButton ID="btnPrevious" runat="server" CommandArgument="Prev"
CommandName="Page" SkinID="pageprev" />
<asp:ImageButton ID="btnNext" runat="server" CommandArgument="Next"
CommandName="Page" SkinID="pagenext" />
<asp:ImageButton ID="btnLast" runat="server" CommandArgument="Last"
CommandName="Page" SkinID="pagelast" />
</PagerTemplate>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
So as you can see, when one or the other is hit I set a textbox to some value then i do a partial postback to my Gridview which is in that Updatepanel.
I suspect it's because you called the "__doPostBack" method. The buttons' normal default click behaviour will perform the Async postback, you probably made it perform another time. Try removing it and see how it goes.
Can you try to put the Click Attribute on the buttons in RowDataBound event declaration??
Cheers.
Try changing your <asp:ImageButtons> to be regular HTML <img> tags.
I've run into this sort of thing before which was hard to diagnose and even harder to explain. See here and here for some buggy behavior that might help. If you have <img> tags with blank src attributes, then the hyperlinks I provided likely explain the problem. If you do not have any blank <img> tags then keep reading for my work around.
In my specific case, it was only happening on some servers (at some client sites) but not others, so I couldn't find any concrete issues with the code. My workaround was to change my <asp:ImageButtons> to regular <img> tags with javascript click events that would call a function to perform the postback, much like your Paging() function.
For some reason, I have found that an <asp:ImageButton> with a client side onclick event of return:confirm('are you sure?'); will stop a postback if the confirm() returns false, however returning false the way you do in your Paging() function after manually calling a __doPostBack does not consistently stop the page from posting back a second time.
Please look at the html as it is rendered on the page:
Every time it's present
<img src=""/>
double postback can happen, for some browser...
This trouble could be resolved setting a default, blank, image for every button
<asp:ImageButton ImageUrl="~/Images/blank.gif"...>
Anyway, this command can be entered in Immediate Window if you put a breakpoint inside Page_Load and allow you to indentify the control that caused postback
Page.Request.Params["__EVENTTARGET"];
I've found a nice solution that works great. It does append it's own handler, but I guess that can be fixed too.
using System.Linq;
private void GridView_OnItemDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
var buttons = e.Row.Cells.OfType<DataControlFieldCell>().SelectMany(item => item.Controls.OfType<ImageButton>());
foreach (ImageButton imageButton in buttons)
{
var argument = imageButton.CommandName + "$" + imageButton.CommandArgument;
imageButton.OnClientClick = this.Page.ClientScript.GetPostBackClientHyperlink(this.GridView, argument) + "; return false;";
}
}
}
Try this, (I don't know why you were using javascript):
bttnrempag.onclick += bttnrempag_Click;
protected void bttnrempag_Click(object sender, EventArgs e)
{
//handle the removal of paging or whatever.
}
You have to provide an image for your ImageButtons. Otherwise the HTML rendered will produce an <img src=""> tag and when this is rendered, it will cause a postback. Try it.