Click here to Skip to main content
15,881,802 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionis there some way i can give the RowIndex as the data key in a gridview Pin
Flavia A5-Nov-09 19:50
Flavia A5-Nov-09 19:50 
AnswerRe: is there some way i can give the RowIndex as the data key in a gridview Pin
sashidhar5-Nov-09 20:11
sashidhar5-Nov-09 20:11 
GeneralRe: is there some way i can give the RowIndex as the data key in a gridview Pin
Flavia A5-Nov-09 20:20
Flavia A5-Nov-09 20:20 
GeneralRe: is there some way i can give the RowIndex as the data key in a gridview Pin
sashidhar5-Nov-09 20:41
sashidhar5-Nov-09 20:41 
QuestionHow to implement re-login in asp.net windows authentication Pin
dharam_hbtik5-Nov-09 19:41
dharam_hbtik5-Nov-09 19:41 
Questionis the some way we can have 2 link button in a grdview? Pin
Flavia A5-Nov-09 19:38
Flavia A5-Nov-09 19:38 
AnswerRe: is the some way we can have 2 link button in a grdview? Pin
sashidhar5-Nov-09 20:29
sashidhar5-Nov-09 20:29 
QuestionCustom control : getting Rowcount 0 on button event of the control. Pin
Imran Khan Pathan5-Nov-09 19:35
Imran Khan Pathan5-Nov-09 19:35 
I am working on custom control. I am creating databound control. I have one property name RowDataSource that
accept DataRowCollection as data source and I bind control on OnDataBinding event. I have another property
name RowItem.
My code looks like this.

public DataRowCollection RowDataSource
{
	get
    {
		if (ViewState["rowDataSource"] == null)
		{
	        ViewState["rowDataSource"] = null;
		}
        return (DataRowCollection)ViewState["rowDataSource"];
    }
	set
    {
		if (value == null)
		{
			throw new ArgumentException("unvalid data source.", this.ID);
		}
		ViewState["rowDataSource"] = value;
	}
}
public RowCollections ExelRows
{
   get
   {
   // rCollection is object of RowCollections class
	if (rCollection == null)
        {
           rCollection = new RowCollections();
        }
        return rCollection;

   }
}

OnDataBinding event code
protected override void OnDataBinding(EventArgs e)
{
	base.OnDataBinding(e);
	if (RowDataSource != null)
	{
		foreach (DataRow dr in RowDataSource)
		{
		    //RowItem is my class
			RowItem item = new RowItem();
			item.Text = dr[rTitle].ToString();
			this.ExelRows.Add(item);
		}
	}
}
   
CreateChildControls method to render control		 
protected override void CreateChildControls()
{
	if (ExelRows.Count > 0)
	{
		//here i am rendering table structure to add exelrows and create control.
	}
}


Now, I am binding this control with DataRowCollection and It works file. I have one button in this control and
I am raising bubble event when button is clicked.

My problem is that when I click on button then CreateChildControls method is called first before OnDataBinding event.
so I am getting ExelRows.Count = 0.

so what I have to do to getting all rows on every bubble event of control.

Thanks
Imrankhan

please don't forget to vote on the post that helped you.

QuestionGoogle Maps, Street View API Pin
pujafaldu5-Nov-09 19:24
pujafaldu5-Nov-09 19:24 
AnswerRe: Google Maps, Street View API Pin
sashidhar5-Nov-09 20:36
sashidhar5-Nov-09 20:36 
GeneralRe: Google Maps, Street View API Pin
pujafaldu5-Nov-09 22:41
pujafaldu5-Nov-09 22:41 
GeneralRe: Google Maps, Street View API Pin
sashidhar5-Nov-09 22:52
sashidhar5-Nov-09 22:52 
QuestionObject expected Error .........please help me Pin
maheshkmr5-Nov-09 19:21
maheshkmr5-Nov-09 19:21 
AnswerRe: Object expected Error .........please help me Pin
Nishant Singh5-Nov-09 20:10
Nishant Singh5-Nov-09 20:10 
Questionhow add a plugin to browser Pin
santhosh-padamatinti5-Nov-09 18:58
santhosh-padamatinti5-Nov-09 18:58 
Questionuser details after login Pin
rahuuul175-Nov-09 18:27
rahuuul175-Nov-09 18:27 
AnswerRe: user details after login Pin
rahuuul175-Nov-09 18:28
rahuuul175-Nov-09 18:28 
GeneralRe: user details after login Pin
Gamzun5-Nov-09 19:00
Gamzun5-Nov-09 19:00 
AnswerRe: user details after login Pin
Christian Graus5-Nov-09 18:54
protectorChristian Graus5-Nov-09 18:54 
GeneralRe: user details after login Pin
rahuuul175-Nov-09 18:57
rahuuul175-Nov-09 18:57 
GeneralRe: user details after login Pin
Christian Graus5-Nov-09 20:13
protectorChristian Graus5-Nov-09 20:13 
GeneralRe: user details after login Pin
Gamzun5-Nov-09 23:18
Gamzun5-Nov-09 23:18 
Questionhow to implement the "remember me" component in the asp web page Pin
Amit Spadez5-Nov-09 17:37
professionalAmit Spadez5-Nov-09 17:37 
AnswerRe: how to implement the "remember me" component in the asp web page Pin
tejesh1235-Nov-09 17:57
tejesh1235-Nov-09 17:57 
GeneralRe: how to implement the "remember me" component in the asp web page Pin
Amit Spadez5-Nov-09 18:00
professionalAmit Spadez5-Nov-09 18:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.