kahvedzic
asked on
how to disable gridview refresh on select row event
How can I disable refresh of gridview when clicking Select button.
Example:
Gridview loads on page load event, in first column I have select button and when I want to select first row, after clicking on select gridview is refreshing and changing color of that row. Problem is if I have a new row in Grid after clicking on button select it will select that new first row except one that I select.
What I want is to disable a refresh of gridview on button select click so I can select row that I want and refresh gridview manualy.
Example:
Gridview loads on page load event, in first column I have select button and when I want to select first row, after clicking on select gridview is refreshing and changing color of that row. Problem is if I have a new row in Grid after clicking on button select it will select that new first row except one that I select.
What I want is to disable a refresh of gridview on button select click so I can select row that I want and refresh gridview manualy.
set AutoPostBack property of gridview to false
ASKER
I have no autopostback property for GridView
what does select button do?
On load page add
if (!IsPostBack)
{
//Grid load
}
if (!IsPostBack)
{
//Grid load
}
ASKER
@HainKurt:
it select gridview row
@fsouzabrasil:
vb please
it select gridview row
@fsouzabrasil:
vb please
ASKER
this tutorial is for selecting gridview row without select button, I need to have select button in gridview. When I click on select button I dont want any new rows created in gridview until I manualy refresh page.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I select row with this
<Columns>
<asp:CommandField ButtonType="Image" ShowSelectButton="True" SelectImageUrl="~/Images/c heck.gif" >
<ItemStyle HorizontalAlign="Center" />
</asp:CommandField>
</Columns>
How to add OnClientClick for this button?
<Columns>
<asp:CommandField ButtonType="Image" ShowSelectButton="True" SelectImageUrl="~/Images/c
<ItemStyle HorizontalAlign="Center" />
</asp:CommandField>
</Columns>
How to add OnClientClick for this button?
No need to add OnClientClick event.
If possible for you, please create CommandField of type link and not image. and if you need to have image there, you can always place that with the help of image tag(html).
I hope this helps. let me know...
If possible for you, please create CommandField of type link and not image. and if you need to have image there, you can always place that with the help of image tag(html).
I hope this helps. let me know...
ASKER
I create select button with OnClientClick = "javascript:return false;" and now works fine.
Thanks.
Thanks.