i'm a asp.net beginner,
and developing a simple content management system using c#.net.
i'm having 2 tables in my DB where the page titles and html content and page title id's are stored.
my task is to pull the page titles from table and display them in a datagrid and when datagrid row is clicked i';ll have to show a html editor(WYSWIG) with its html content loaded if html content exist in the table.
i succeeded in pulling page title column from database to the datagrid, now i need to display the html editor with relative data based on datagrid row ID.
can anyone please help me out..
I would recommend you have an "Edit" button/link on the gridview row, which then clicks through to a page with the WYSIWYG editor on. Will make ur life a bit easier. I would also recommend you use tineMCE. Def one of the better WYSIWYG editors out there
Thanks for the comeback.
I would like to ask you a question, how to enable a html editor when datagrid row has been clicked?
and i need to capture datagrid row ID and put it in a variable.
here is my code for tha, can you please suggest how to do this.
private void PopulateDataGrid()
this.dgContentManagement.DataSource = ContentManagementActivities.GetContentManagementDetails();
protected void dgContentManagement_RowDataBound(object sender, GridViewRowEventArgs e)
if (e.Row.RowType == DataControlRowType.DataRow)
e.Row.Attributes.Add("onclick", ClientScript.GetPostBackEventReference(this.dgContentManagement, "Select$" + e.Row.RowIndex.ToString()));
protected void dgContentManagement_SelectedIndexChanged(object sender, EventArgs e)
Int32 ContentPageId = Convert.ToInt32(dgContentManagement.SelectedValue);
//You have to insert related code here
//ContentPageId = this.dgContentManagement.SelectedValue.ToString();
//Response.Redirect("ContentManagementHome.aspx?" + "content_page_id=" + this.dgContentManagement.SelectedValue.ToString());
//txtContentDescription.Visible = true;
//btnSubmit.Visible = true;
You should be able to pick it up with dgContentManagement.DataKeys[e.RowIndex]. Not 100% sure now as I have not used this in a while.
Just also make sure you set the correct column as the Key for the gridview.
This topic is now archived. It is frozen and cannot be changed in any way.