>What I'm saying here is if you first added their project to the toolbox, then dropped it on a form, the editor will automatically add a reference to this gridview project. If you then added the code from this project to your existing project you now have a conflict between the external reference which was added and the code you just added to your project. You would need to remove the project from References.
>
>>If I would not add this GridView on the toolbox, how would I use this class in my pages?
>
>Take a look at the code that was generated when you dropped it on the form - you can write similar code. However, I'm not saying that you can't have it in the toolbox, only that if you did what I described above, it will cause problems.
>
>>Also why did he name the class GridView and not some custom SortingGridView?
>>May be the idea was that having just adding this class to the App_Code all your grids would automatically use this GridView class and not the default GridView?
>
>No idea. I guess so.
>
>>When you tried it yesterday, did you try to create a new project and add it there?
>
>No, I just opened their project to take a quick look at the code.
Looks like I would have to re-do it again. Somehow I messed up and now the arrows don't show even if the demo application (though they don't show broken image control either).
This was the method I added (need to have it since I'm going to delete the folder and re-do everything again):
protected override void OnRowCreated (GridViewRowEventArgs e)
{
base.OnRowCreated(e);
string onmouseoverStyle = "this.style.backgroundColor='#0bf'"; // Deepskyblue
string onmouseoutStyle = "this.style.backgroundColor='@BackColor'";
string rowBackColor = String.Empty;
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowState == DataControlRowState.Alternate)
rowBackColor = System.Drawing.ColorTranslator.ToHtml(this.AlternatingRowStyle.BackColor).ToString();
else rowBackColor = System.Drawing.ColorTranslator.ToHtml(this.RowStyle.BackColor).ToString();
e.Row.Attributes.Add("onmouseover", onmouseoverStyle);
e.Row.Attributes.Add("onmouseout", onmouseoutStyle.Replace("@BackColor", rowBackColor));
}
}
If it's not broken, fix it until it is.
My Blog