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


Post New Web Links

Custom control inside a GridView

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

Hi All,

I have created a custom pager control for implementing paging which has four link buttons, two textboxes and two buttons in it. I have derived that control from a Panel and have implmented the INamingContainer and IPostBackDataHandler interfaces.

Problem:
Every time I click on either LinkButtons or on buttons, the page gets posted back to the server and the LoadPostData method of IPostBackDataHandler gets called (as expected). But, the click event of the control that is cliked gets fired every alternate time.

E.g.: If I click on the LinkButton named 'First' for the first time, the click event handler will execute. Next time when I click on the same LinkButton, only the LoadPostData will get executed. Again, when I click on the same LinkButton, the event handler will execute properly. This pattern remains the same for all the buttons.

Please let me know if any one has encountered such a situation and what can be a solution to it.


Thanks,

Girish :)




View Complete Post


More Related Resource Links

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.

find a Control inside a GridView using jQuery

  

I have databound GridView in my page and I have a hidden DIV in all rows. Each row contains a Button that I want it to make the DIV visible for me! how can I use that with jQuery?!


here is the code page: 


<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                                EnableModelValidation="True" GridLines="None" ShowHeader="False" Width="100%">
                                <Columns>
                                    <asp:T

image inside custom server control

  

Hi,

I want to use an image inside a Custom Web server control ! 

Do I need to use Web.resources ? if so , how to do ?


RadioButtonList inside the GridView control

  
Hi, I have several rows inside the GridView control and each row contains a RadioButtonList control. I select the option c from the RadiobuttonList but when I press submit I always get the first index of the RadiobuttonList which is a). Hence, the RadiobutonList is not maintaining the selected positions. Any idea how to maintain the value.

change the color of label control inside gridview

  

Hi i am saving color as a string in database 

i have a gridview control

 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowUpdating="Update_Schedule"
                    OnRowDeleting="Delete_Schedule" OnPageIndexChanging="OnPaging" OnRowEditing="Edit_Schedule"
                    OnRowCancelingEdit="CancelEdit" PageSize="10">
                    <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:CheckBox ID="Todo" runat="server" AutoPostBack="true" Height="23px" OnCheckedChanged="CheckedChanged" />
                                <asp:HiddenField ID="hdn_ScheduleID" runat="server" Value='<%#Eval("ID") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:Label Text='<%# Eval("Title") %>' runat="server" ID="lbl1"></asp:Label>
                            </ItemTem

Use GridViewPager for GridView in Custom Web Control

  

Hi,

I Use dynamic data's gridviewPager for my GridView, where my gridview bind manually in code behind.

But the when i change the text in textbox (page no), or click on previous, back, next or last, the control is not working and my gridview is not updated to tat page i keyed in.


Please advice on that. Thx


Multiple Fileupload into the sharepoint document library using Fileupload control inside gridview

  

Hi,

how to upload multiple files to the sahrepoint document library using fileupload control inside the gridview.?

this is my form design:

<div>

<asp:Gridview id="gridview" runat ="server" autogentatecolum="false">

<columns>

<asp:TemplateField Headertext="3DFinal" runat="Server">

<ItemTemplate>

<asp:FileUpload id="Fileupload1" runat ="Server"/>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField Headertext="2DFinal" runat="Server">

<ItemTemplate>

<asp:FileUpload id="Fileupload2" runat ="Server"/>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField Headertext="2Conceptaul" runat="Server">

<ItemTemplate>

<asp:FileUpload id="Fileupload3" runat ="Server"/>

</ItemTemplate>

</asp:TemplateField>

</columns>

</asp:GridView>

</div>

<div>

<asp:Button id="Save" runat="server" Text="Save" onClick="btsave-Click"/>

</div>

 

If i click the save button the files should go to the sharepoint document library?

i need to uplaod multiple files to the document libray using file upload inside the gridview..

any one know about this file

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

  
In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.
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