.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan
Asad Ali
Fauzul Azmi
Post New Web Links

HELP ! - how to disable spesific control inside the grid view

Posted By:      Posted Date: October 03, 2010    Points: 0   Category :ASP.Net
 

Hello....

I need to disable the "Imagebuttons" after the user click on one of them... I've sucessfully updated the table when the user click on a button using the following code on the event of row command of the gridview...

PLEASE NOTE THE THE GRIDVIEW IS INSIDE UPDATE PANEL !

if (e.CommandName == "voter_up")
        {
            SqlCommand voteup = new SqlCommand("update arto_comments set voteup = voteup+1 where cid=" + e.CommandArgument, con);
            SqlCommand getVup = new SqlCommand("select voteup from arto_comments where cid =" + e.CommandArgument, con);
            con.Open();
            voteup.ExecuteNonQuery();
            //lblvoteup.Text = Convert.ToString(getVup.ExecuteScalar());
            con.Close();
            //GridView1.Rows[1].FindControl("ImageButton1"). = false;
            ImageButton1.Enabled = false;
            GridView1.Rows[0].FindControl("ImageButton1").Controls;
}




so please how may I disable these buttons after database is updated ?

Thanx and Regards




View Complete Post


More Related Resource Links

I need to be able to disable a button inside a repeater control when an item in the data is <1

  
For example, I have an inventory table. If any one of the items is less then one, I need to disable the button. <asp:Repeater id="repeater1" <ItemTemplate> <asp:Button id=btnSize /> </ItemTemplate> </asp:Repeater>  

Unable to store combo box value to data grid view control

  
Hello,         I am using fw 3.5 SP1 with VS2008. I have bind my object collection with data grid view. I can see different values in combo box inside data grid view. But when I select any one value from combo box the selected value is changed to first value of combo box as soos as user leave the cell of the gird. Can anyone tell me where should I look for this problem so that my selected value remains same as user did select it.   Nilkanth Desai  

Grid view control problem

  
HiI am using the grid view control where i am using <asp:CommandField for editing & deleting i want to visible false of this coloumn with edit & delete button..how do this.Thanks<asp:GridView DataKeyNames="StaffCalendarId"  PagerSettings-Mode="NumericFirstLast"                                                        PagerStyle-HorizontalAlign="Center" ShowHeader="true" AllowPaging="true" AutoGenerateColumns="False"                                                        Width="100%" ID="gvEventInfo" runat="server" CellPadding="4" ForeColor="#333333"                            &nbs

Disable a link button in grid view after it is clicked

  
I have a grid view with each row as a link button. When I click on the row, some data parsing process takes place (about a 15 sec process). The grid refreshes itself at a regular interval. I want to disable the link when it is clicked once, so that the user gets to know that row has been processed already and does not click it again, until the grid refreshes itself and the row disappears. I am copying my gridview code below. Please give me some idea on how to disable the link button on that row as soon as it is clicked.Thank You. <td rowspan = "4" valign = "top" > <asp:Label ID="gvOrdersQueueLabel" runat="server" ></asp:Label><br /> <asp:UpdatePanel runat="server" ID="updatePane1"> <ContentTemplate> <asp:GridView ID="gvOrdersQueue" runat="server" OnRowCommand = "ParseOrderMessage" EmptyDataText="No Cases Found" BorderStyle = "Double" AlternatingRowStyle-BackColor="Beige" EnableViewState="false" AutoGenerateColumns="False" HeaderStyle-Height = "20" RowStyle-Height = "20" AllowPaging ="true" PageSize = "20" OnPageIndexChanging="gridView_PageIndexC

delete using boung field value inside grid view

  
I want to delete data using boung field value inside grid view, I am doing this...but it is not finding bound field value<asp:BoundField DataField="nsid" HeaderText="nsid" SortExpression="nsid" Visible="false" />protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)    {        string sid = GridView1.DataKeys[e.RowIndex]["nsid"].ToString();        SqlCommand cmdx = new SqlCommand("delete from blogreply where sid='"+sid+"'",con);        con.Open();        cmdx.ExecuteNonQuery();        con.Close();please anyone tell me how to find bound field value..

Trying to incorporate the use of a dropdown list control with a grid view control

  

I'm trying to setup a page that will utilize a dropdown list control inside of a grid view control using VS 2005 2.0 version. Everything that I can find online seems to only show the use of the dropdown list control using a data grid. I don't want to use a data grid because it doesn't have the functionality/ power as the grid view control. Can someone please tell me how I can incorporate a dropdown list control with the grid view control? Here is a copy of my code.



<asp:GridView ID="HardwareSetdv" runat="server" AllowPaging="True"
        AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="AcctID"
        DataSourceID="HardwareSetSqlDataSource">
        <Columns>
            <asp:CommandField ShowSelectButton="True" />
            <asp:BoundField DataField="HardwareSetID" HeaderText="HardwareSetID"
                InsertVisible="False" ReadOnly="True" SortExpression=&quo

problem in selecting deslecting multiple records in grid view by clicking control key.plz help

  

i want to select/deselect multiple records inside grid view by clicking control key.I can do the selection but the deselection is not working properly..there is some thing wrong in the  logic.plz help me to solve the problem.

my java script function is like..

<script language="javascript" type="text/javascript">

    function FillColor(cellid, id, evt) {
    
        var isSelected = document.getElementById('<%=hidSelectedRow.ClientID%>');
        alert(cellid);
        if (!evt) var evt = window.event;
        ctrlPressed = evt.ctrlKey;
        if (!ctrlPressed) {
            //alert(ctrlPressed);
            var clearCellColor = document.getElementById('hidCellId').value.split(',');
            for (i = 0; i < clearCellColor.length; i++) {
                document.getElementById(clearCellColor[i]).bgCol

How to Disable Specific Column in Data Grid View and write something in Cell and load data in anothe

  

Hello All  ,

i have data grid view and i want to disable specific column from writing in it and in another column 

i want to write something like item code and load the item name automatically in the corresponding cell in the disabled column 

i hope that i write my problem correctly and you can understand what i want :)

thanks in advance ,


Kareem Naguib

problem in selecting deslecting multiple records in grid view by clicking control key through java

  

i want to select/deselect multiple records inside grid view by clicking control key.I can do the selection but the deselection is not working properly..there is some thing wrong in the  logic.plz help me to solve the problem.

my java script function is like..

<script language="javascript" type="text/javascript">

    function FillColor(cellid, id, evt) {
    
        var isSelected = document.getElementById('<%=hidSelectedRow.ClientID%>');
        alert(cellid);
        if (!evt) var evt = window.event;
        ctrlPressed = evt.ctrlKey;
        if (!ctrlPressed) {
            //alert(ctrlPressed);
            var clearCellColor = document.getElementById('hidCellId').value.split(',');
            for (i = 0; i < clearCellColor.length; i++) {
                document.getElementById(clearCellColor[i]).bgC

Using Drop down menu in a grid view control for entering new data

  

I wish to use drop down menu(based on a table of my database) to update/insert data in a web form. The data is then fetch in to SQL table (Express).

How to do it ? 


Find Control inside a View of Multiview using Javascript (document.getElementById)

  

Hi,

i am using the multiview control inside a page and i am trying to find a control using the javascript function document.getElementById. My Problem is that the function returns null cause it cannot find the control. When i open the code of the page from the browser the active view is not rendered so I think thats the reason why I am getting a null value from the function. 

On the HTML code is rendered only the first view or the view that is activated on page load.

Is there any way to find a control inside the view using javascript? or I am doing something wrong?


Thanks a lot.


Bind nested grid view and find value from control within nested grid

  
The article Bind nested grid view and find value from control within nested grid was added by ramkrishnsaini on Wednesday, December 29, 2010.

Introduction: In this article i'm posting "How to bind nested grid view and work with nested control with nested grid view".Binding nested grid and work with any control of nested grid view is something different than normal grid view. In

Can we disable the hyper link in a SharePoint tree view control

  

We have created a Tree view control for the ease of navigation. Is it possible to disable the hyperlink and keep the text only in the control.

 

I am not sure if this make any sense. Please see the below scenario

 

·         Site

o   

Accessing the different controls inside a GridView control

  
how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

How To Add calendar control inside a GridView

  
This article show hot to add calendar control inside a GridView with code in c#

Using ATLAS PopUp Control with Calendar inside the GridView Control

  
In this video tutorial Mohammad demonstrates how you can access the Calendar control which is displayed using the ATLAS PopUp control inside the GridView control.

jQuery grid view plugin

  
jqGridView is new, client-rich, XML-based, ajax grid plugin for jQuery library. jqGridView provides professional solution for representing and editing tabular data on the web. Carefully designed, with powerful script API, this editable DHTML grid is easy configurable with XML, and shows convincing results working with large amounts of data. jqGridView allows easy implementation of nice looking(managed through css). jqGridView is not platform-depending plug-in, it can be used with different web -programming platforms like: ASP .NET/ASP, PHP, JAVA, CGI scripts etc. jqGridView has hight bowser compatibility.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend