Forms Data Controls :: Show Columns In Gridview Based On Access Rights?
Feb 3, 2011
I want to show columns in gridview based on access rights/roles.That is i want to show parents column if there is parents login or else i want to show students column if there is students login.
View 2 Replies
Similar Messages:
Oct 10, 2010
I have a master table that will hold the information for publications for my company. Not all of the publications can veiwed by all users. What I am trying to figure out is how can I load all of the publications that the user is allowed to see into one grid view table. For example: If Mary logs in she will only be able to see Accounts publications; if Sally logs in she can see General and Legal publications and if John logs in he can see IT, Legal and General publications.
I figured out how to do it with separate gridview tables on a page based on the roles. I would make a gridview viewable if the user was in that role. But I would really like to put all of this in one gridview if that is possible.
View 8 Replies
Jul 16, 2010
I have an emergency request that I need to sort it out very quickly as I did not notice it early :(.
I have a dropdownlist, the contnet in the gridview (sqldatasource connection) changes based on the value the user slects, say I have play1, play2 from the dropdownlist, I would like to show column1, column2 and column3 with user selects play1; show column4, column5, and clomn6 when use selects play2; the datatable actually includes all 6 columns.
I understand that I need to use something like RowCreated event, and I need to set up condition based on the dropdownlist value, but I dont really know how to.
View 3 Replies
Nov 8, 2010
I had just started with Visual Studio 2008 + VB.net. I've now designed my tables, and basic gridview functions properly.Now I'm faced with the problem of having to calculate a value based on 2 - 3 columns/data in the gridview, display the result in an existing column in the same gridview, and saving the calculated value in the datasource.I had initially created the "Total" column as a textbox displaying a manually calculated amount that is saved in the datasource. Now, I want to change the field to auto-calculate based on 2 other columns.
View 4 Replies
May 4, 2010
Currently I have something like this, but when I click "update" the record doesn't get updated (but no error is returned).
[Code]....
View 5 Replies
Nov 11, 2010
i have a grid view and i want to show the sum of columns in footer.
View 2 Replies
Jun 22, 2010
I want to show default Column names in my grid, if the data is not coming from the database.
like:
ID Name Date
but with blank values..... you can just a blank grid.
View 2 Replies
Feb 9, 2011
how i can filter gridview coloumns data based on textbox event ONKEYUP....
View 15 Replies
Jul 15, 2010
I have a webpage that lists information about trucks and their map sections and whether the combination is active and will be used.
On the page I put a check box that says Show Only Active and marked the checked property as true by default. When the RowDataBound event fires I check to see if that checkbox is marked as true and if it is I check if the individual map sections are marked as active. If they are not active then I set the row visibility equal to false like below.
[code]....
View 1 Replies
May 24, 2010
dv = new DataView(table);
Table.Columns.Add("ID", typeof(string));
table.Columns.Add("Type", typeof(string));
table.Columns.Add("EmpName", typeof(string));
table.Columns.Add("Manager", typeof(string));
row = table.Rows.Add();
row["ID"] = result["ID"].ToString();
row["Type"] = result["Type"].ToString();
row["EmpName"] = result["EmpName"].ToString();
row["Manager"] = result["Manager"].ToString();
Then I am adding boundfield to gridview for all 4 columns. Now I want to check if "Type" column contain "Sales" thne do not show "Manager" columns. Let me know can I do this?
View 4 Replies
Nov 5, 2010
I have a gridview. In my RowDataBound handler I'm doing some things to columns, and accessing them like this for example,
e.Row.Cells(7).BackColor = System.Drawing.Color.Salmon So, of course when I rearrange the order of my columns everything breaks.
Isn't there some way to give an ID to a column, and say e.Row.Cells("TotalColumn_ID") ?
Will this work? Do columns have IDs?
View 2 Replies
Dec 9, 2010
I am developing a form where I have a gridview control which I shows data from sql database. Sql query:
I also have a label control. What I want to do is to show label control when gridview cell value is > 3.
Could you tell me if it is possible to make label control visible based on gridview value?
Here is my code:
[Code]....
View 3 Replies
Jan 12, 2010
How do i show the available data based on the dates? Something like the show only FUTURE dates data.
View 4 Replies
Nov 22, 2015
[URL]
Above Links Works For Only When Gridview Has All Boundfield Columns and Last Templatefield Column having Radiobutton.
But not Works when All TemplateField Columns Having Textbox or Label in gridview like
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" BorderColor="Black"
DataKeyNames="ID,Type" BorderStyle="Solid" BorderWidth="1px" CellPadding="4"
CssClass="Gridview" OnRowDataBound="GridView1_RowDataBound">
<Columns>
[code].....
View 1 Replies
Mar 30, 2010
I am using VS2008.I am binding dynamic datatable to gridview. I have few dropdowns and textboxes in gridview.
I have dropdownlist(ddlTrCodeNw_)in gridview foooter template. Based on the selection of Trcode value few controls will be enabled,disabled,visible,hide. in gridview.
<asp:GridView ID="gvAPPost" runat="server" Width="100%" ShowFooter="true"
AllowPaging="true" AutoGenerateColumns="false"
onrowcommand="gvAPPost_RowCommand"
onrowdatabound="gvAPPost_RowDataBound"
>
<Columns>
<asp:TemplateField HeaderText="Discount %" Visible="false">
<FooterTemplate>
<asp:TextBox ID="txtDiscountPerNw" runat="server" Width="40px" Enabled="false" Visible="false" ></asp:TextBox >
</FooterTemplate>
<ItemTemplate>
<asp:TextBox ID="txtDiscountPer" runat="server" Width="40px" Enabled="false" Visible="false"></asp:TextBox >
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Intially I set TemplateField HeaderText also Visible="false".
so i have written the condition in ddlTrCodeNw_SelectedIndexChanged.
Now when
if(ddlTrCodeNw.SelectedValue=="24")
{
txtDepstNw.Enabled = true;
txtDepstIncNw.Enabled = true;
txtCrdtNw.Enabled = false;
txtCrdtIncNw.Enabled = false;
lblDiscTrcodeNw.Visible = true; // I want to show this TemplateField HeaderText also when i need.
}
I can I show TemplateField HeaderText also whenever i need.
View 3 Replies
Jun 17, 2012
i have done sending gridview data as excel to mail, it is working fine
then i had 5 columns in gridview but i want to send 4 column instead of 5 column.
protected void Button1_Click(object sender, EventArgs e)
{
fn_AttachGrid(); // here calling function to send mail gridview data as excel format
}
[Code]....
View 1 Replies
Nov 22, 2015
I am adding two button in gridview here I populate gridview on page load this work fine problem is that when my status value are check or peending then my two button are show.
But I want when my status value are check then check button should be hide
And view button show in which row where staus value are check But when my status value are peending here show check button and view button should be hide. I want follwing type .
Gridview Like that on page load
id name class status
1 imran 5 check
Hide Check button
View Button Show
2 ali 8 pending
Check Button Show
View Button Hide
3 farooq 7 check
Hide Check button
View Button Show
How to do it following my code.
Default.Aspx.cs
protected void Button1_Click(object sender, EventArgs e)
{
populategridview();
}
public void populategridview()
{
string strConnString = "Data Source=.SQLEXPRESS;Integrated Security=SSPI;
[Code] .....
View 1 Replies
Dec 5, 2013
I am stored date in "smalldatetime" datatype as in databse.How can i particular textbox entered date(dd-mm-yyyy) used to fetch the row information from databse and shown in a gridview.
View 1 Replies
May 7, 2015
This is my Code
My query is if i select Other in dropdownlist i want visible textbox..
how to i do it..
<asp:GridView ID="TypeFruit" runat="server">
<Columns>
<asp:TemplateField HeaderText="Type" >
<ItemTemplate>
<asp:DropDownList ID="ddlfruit" runat="server" >
<asp:ListItem Value="0">Select</asp:ListItem>
<asp:ListItem Value="1">Fruit</asp:ListItem>
<asp:ListItem Value="2">Other</asp:ListItem>
</asp:DropDownList>
<asp:TextBox ID="TxtOther" runat="server" Visible="false"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
View 1 Replies
Feb 24, 2014
I want to get the values from the Invisible rows from my gridview. here is my code.
<asp:GridView ID="gvTeam" runat="server" Width="900px"
AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966"
BorderStyle="None" BorderWidth="1px" CellPadding="4">
<Columns>
<asp:BoundField DataField="FULLNAME" HeaderText="NAME" />
<asp:ButtonField DataTextField="EVALUATION" HeaderText="EVALUATION"
Text="EVALUATION" CommandName="select" >
[Code]...
View 1 Replies
May 7, 2015
In my query i have 1 gridview..
In this gridview i have 1 dropdownlist and 1 textbox..
textbox is in visible=false state..
My question is after selecting dropdown list selected value i want visible textbox in gridview..
View 1 Replies
Dec 19, 2012
i am using template field display image based on condition in table field. i have field name verify i used to store yes or no value if it is yes then display image else noting to display in gridview
View 1 Replies
May 7, 2015
I am checking string and then bind category. If condition is false then i need anchor tag in which i pass querystring to specific link.
<itemtemplate>
<asp:Literal runat="server" ID="litPrice" Text='<%#((String.IsNullOrEmpty(Eval("Price").ToString()) || Eval("Price").ToString()=="00/0.00" || Eval("Price").ToString()=="0/0.00") ? "<span font-family="arial"><a href="http://www.xyz.com/web/enquiries.asp?category="+ Eval("category")>Enquiry</a></span>" : Eval("Price"))%>' >
</asp:Literal>
</itemtemplate>
I am getting error. CS1010: Newline in constant
View 1 Replies
Mar 18, 2010
in asp.net page user able to select gridview Columns, and it will hide remaining columns and that selection done by check box with column list bellow is Image link , what exactly I am looking for [URL] it look bellow after selection of column done [URL]
View 1 Replies
Jan 27, 2011
I have a datasource, which includes many columns, idealy, I need use a gridview to show:
1) first 3 columns: template fields, these fields depends on values in some columns of datasource. I use template fields, hard coded. works fine.
2) the other columns. This is I do not know how to do it. In the data source, there are about 10-20 columns data, each time, the # of columns of the data varies. idealy, I need show each of them as a seperated column in gridview. The entire data source may have 30 columns, but some of them are used in 1), and I only want show these 10-20 columns in gridview. Some columns in data source, I may not use them at all. is there a way to do this? or have to seperate them as a detail view style UI?
View 1 Replies