English 中文(简体)
GridView that toggles percentages of counts
原标题:

I am using a SqlDataSource that returns a table of raw counts. One of these columns is the "total". I would like to give the user the ability to show these counts as a percentage of total using some sort of toggle switch.

My initial idea was to have two CSS classes and somehow put <span class="raw"> and <span class="perc"> around each value and then make one or the other invisible using Javascript. I m not sure how I would go about doing this though.

I would appreciate any suggestions as to how I could approach this.

最佳回答

My suggestion would be to add a handler to the RowDataBound event of the GridView control and change what the column displays based on the toggle value.

问题回答

Have you tried changing the column visibility based on a button press event?





相关问题
asp.net gridview editindex

Please take a look at this: protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { int index = Convert.ToInt32(e.CommandArgument); if (e.CommandName == "Edit") {...

How do I stop my gridview from caching?

I search for results, click one, it opens in a new window, then edit it, and close the popup. Then I hit search to refresh my gridview, but the changes do not reflect unless I hit F5. It s caching ...

get data from gridview without querying database

I am new at this so please bear with me... I have managed to get the following code to work...so when I click on the "select" link in each row of the gridview, the data is transfered to other label/...

WPF GridView, Display GetType().Name in DisplayMemberBinding

I want include the Type name of each object in my collection from my GridView. I have a collection which has four different types in it that all derive from a base class. Call them, Foo, Bar, Fizz, ...

GridView that toggles percentages of counts

I am using a SqlDataSource that returns a table of raw counts. One of these columns is the "total". I would like to give the user the ability to show these counts as a percentage of total using some ...

热门标签