C# - Show Gridlines On A Grid
Mar 10, 2010
I'm using Rad Grids and I use the built in Skins for appearance. However, I 'd like to add Gridlines for my Grid. Gridlines = "Both" does not seem to work.
<telerik:RadGrid ID="RadGridProviders" Width="100%" GridLines="Both" AllowPaging="true" Skin="WebBlue" runat="server" DataSourceID="SDSProvider" AutoGenerateColumns="false">
<MasterTableView DataSourceID="SDSProvider" PageSize="7" CellPadding="0" GridLines="Both" CellSpacing="0" DataKeyNames="ID,Entry_Loc" AllowMultiColumnSorting="True" AutoGenerateColumns="false" >
<PagerStyle Mode="NextPrevNumericAndAdvanced"/>
<Columns>
<telerik:GridBoundColumn HeaderText="Organization Name" HeaderStyle-HorizontalAlign="Center" DataField="OrgName" SortExpression="OrgName">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Provider Type" HeaderStyle-HorizontalAlign="Center" DataField="TypeofProvider" SortExpression="TypeofProvider">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Contact Name" HeaderStyle-HorizontalAlign="Center" DataField="Contact" SortExpression="Contact">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Address" HeaderStyle-HorizontalAlign="Center" DataField="Address" SortExpression="Address">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Contact Number" HeaderStyle-HorizontalAlign="Center" DataField="Phone" SortExpression="Phone">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Creator Location" Visible="false" HeaderStyle-HorizontalAlign="Center" DataField="Entry_Loc" SortExpression="Entry_Loc">
</telerik:GridBoundColumn>
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" HeaderText="Delete Provider" HeaderStyle-HorizontalAlign="Center"
ConfirmText="Are You Sure You Want to Delete this Provider?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete Provider Confirmation"
UniqueName="DeleteProv">
</telerik:GridButtonColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
I just tried adding custom CSS
.mytable tr td
{
border: solid 1px #000000;
}
I set the css class for the item style inside of the masterr table, i set it on the master table and on the grid itself. Didn't work.
View 2 Replies
Similar Messages:
Aug 20, 2010
i am resizing grid view column header in updatepanel using javascript,it is working properly but my grid view displaying large amount of data at that time,so i need to come top of page for resizing gridview column header,so can i resize Grid view column header using gridlines?
gridlines means we can resize column in gridview anywhere,but i don't know it is possible or not?
View 1 Replies
Jun 30, 2010
I'm getting some Xml back from a service. I would like it to be the datasource of a grid view on my aspx page. Here is a sample of the Xml
<?xml version="1.0" encoding="utf-16" ?>
<ArrayOfTripTollCompleteDC xmlns:xsi=[URL]"
xmlns:xsd=[URL]>
<TripTollCompleteDC>
<TripTollId>5</TripTollId>
<DMSLaneModeID xsi:nil="true" />
<HOVOnly>false</HOVOnly>
<CreateDateTime>2010-06-07T15:54:01.023</CreateDateTime>
<ConfigVTMSDelaySeconds>5</ConfigVTMSDelaySeconds>
</TripTollCompleteDC>
and here is my code that parses the xml and tries to bind the grid. What am I missing here?
var retVal = service.GetTripDetailsByTripID(tripId);
var xmlTrips = XDocument.Parse(retVal);
var tripTolls =
from t in xmlTrips.Elements("TripTollCompleteDC")
select new {
TripTollId = (int)t.Element("TripTollId")
, DMSLaneModeID = (int?)t.Element("DMSLaneModeID")
, HOVOnly = (bool)t.Element("HOVOnly")
, CreateDateTime = (DateTime)t.Element("CreateDateTime")
, ConfigVTMSDelaySeconds = (int)t.Element("ConfigVTMSDelaySeconds")
};
grdTripDetails.DataSource = tripTolls;
grdTripDetails.DataBind();
I realize these are anonymous types. Is that a problem? I have verified the service is returning the Xml as stated above. Can anyone out there point me in the right direction? Just for completeness, here is the grid markup <asp:GridView runat="server" ID="grdTripDetails" />
View 1 Replies
Feb 2, 2011
I have an entity "Order", which contains a set of states. Every state has date and name.
I want show grid with all orders and in grid one column with last state of order. But I dont understand how to do it.
View 1 Replies
Apr 20, 2010
I have gridview and want to show datalist in grid view view column on click of linkbutton show.
[Code]....
View 2 Replies
Feb 11, 2010
In my gridview I want there to be gridlines to separate the columnheaders only, no gridlines otherwise. How would I do that?
View 1 Replies
Feb 15, 2010
I'm using a System.Web.UI.DataVisualization.Charting.Chart in VS 2008 / ASP.Net 3.5 with two y-axes. how to get rid of that horizontally gridlines of the second y-axis?
View 2 Replies
Aug 30, 2013
how to change the color of gridlines?
I tried 2 codes but its not working:-
protected void MyGrid_RowDataBound(object sender, GridViewRowEventArgs e)
{
foreach (TableCell tc in e.Row.Cells)
{
tc.Attributes["style"] = "border-color: #c3cecc";
}
}
and
protected void Page_Load(object sender, EventArgs e)
{
this.MyGrid.Attributes.Add("bordercolor", "c3cecc");
}
View 1 Replies
Mar 15, 2014
I use gridview in my page below is code
<asp:GridView ID="GridView2" runat="server"
AutoGenerateColumns = "false" Font-Names ="Tahoma"
AllowPaging ="true"
OnPageIndexChanging = "OnPaging" PagerStyle-CssClass = "GridPager" PagerSettings-Mode="NumericFirstLast"
BorderColor="#02ca02" BorderStyle="Solid" BorderWidth="1px" RowStyle-BorderColor="#02ca02"
RowStyle-BorderStyle="Solid" RowStyle-BorderWidth="1px"
AlternatingRowStyle-BackColor = "#C0C0C0" ShowHeader="False" GridLines="both">
Here I put gridlines="both" and bordercolor="#02ca02"
In chrome it shows color of gridview's border correctly but in firefox it shows gridviews border in black color....
View 1 Replies
Nov 9, 2010
In my Gridview, I have set Gridlines to None and the gridlines in the body of the gridview are gone. However, the gridlines in the Header and Footer remain. How do you get rid of the gridlines in the header and footer?
Is there a way to do this with a stylesheet?
View 4 Replies
Sep 28, 2010
I need to set 1px Image as Horizontal and Vertical GridLines, gridBorder, HeaderSeperator in a GridView.
View 2 Replies
Mar 9, 2010
I have a grid with Data in that grid first column has so what I am doign is if user clicks + sign I am expanding row to show other row,I need to have a button in the page.. once I click that I need to expand all the accounts. how to do this using asp.net MVC ?
View 5 Replies
Mar 10, 2011
I have encrypt password in Database when i show it in Grid, the password is in Encrypted format i need to send password in decrypt method & than show in grid...... string query = "select Credit_CardNo From fee_CollectPayment order by PID desc"; grid.datasources = query; i need to decrypt password & than assingn it on datasources.
View 7 Replies
Feb 22, 2010
I am unable to view my grid view already linked to my data source. when i run it locally it does not show... Is there any thing else should i include when calling Grid view in Ajax ?
View 2 Replies
Aug 9, 2010
just wanted to know what is the best and easiest way to show a gridview footer for data entry even when the gridview is empty ?
View 2 Replies
Dec 1, 2010
i am working in MVC and using jquery.jeditable plugin.The editing is working fine in grid.when i update the content in grid & click on enter the edit post from my controller cllass is called & returns a string as updated text. i want to show a message somewhere else on my page after the update is done.
[HttpPost]public
string edit(FormCollection collection)
{.....
// show success message on page other then grid column
... return <updated column value>;
}
View 2 Replies
Feb 7, 2011
I have class Person, having two properties First Name and Last Name, if I set array of person as Data Source to GridView how can I show both First Name and Last Name in one column?/
View 2 Replies
Mar 18, 2011
I have 10 gridview within panel... so i have 10 panel+gridview, i want show one at a time(if click my button or click one control) like drag panel with close button ... how i do that.
View 4 Replies
Jan 23, 2011
I have a gridview and in this grid one link button "view" is in each row
when we click on view button we want to show the another grid in the same column
View 12 Replies
Jul 14, 2010
I'm currently binding a simple grid and show. And a separate dropdown and show. Now I want to place dropdown in grid and bind also I will able to change value of dropdown and save.Problem in grid binding drop down not able to find datasource.my code as -
<asp:TemplateField HeaderText="REPORTING TO" Visible ="true" SortExpression="reporting_to">
<ItemTemplate>
<asp:Label ID="Lnk_ReportingTo" unat="server" text="<%# bind('reporting_to' ) %>" ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
//Binding grid
public void BindData()
{
//Calling To Dal From BLL LAYER
DataSet ds = musergroupBLL.GetUserGroup(0, UserFk, 0);
Grd_UserRole.DataSource = ds;
Grd_UserRole.DataBind();
}
For dropdown fill in page on .aspx
<asp:DropDownList ID="DDManager" runat="server" onselectedindexchanged="DDManager_SelectedIndexChanged"></asp:DropDownList>
On .cs
protected void FillDD()
{
DataSet ds = MUsrBll.GetUser(MUsrolEnt);
DDManager.DataSource = ds;
DDManager.DataTextField = "usr_id";
DDManager.DataValueField = "usr_PK";
DDManager.DataBind();
}
Till here every thing is workingfor simple grid.
<asp:TemplateField HeaderText="REPORTING TO" Visible ="true" SortExpression="reporting_to">
<ItemTemplate>
<asp:Label ID="Lnk_ReportingTo" unat="server" text="<%# bind('reporting_to' ) %>" ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
Now changing above code from below aspx code for dropdown place in grid. But not getting how to call datasource and selected value in grid. Data source is same as FillDD()function above for dropdown.
<asp:TemplateField HeaderText="REPORTING TO" Visible ="true" SortExpression="reporting_to">
<ItemTemplate>
<asp:DropDownList ID="Lnk_ReportingTo111" SelectedValue='<%# bind('reporting_to' )%>' DataSource = "<%# bind('usr_PK' )%>" DataTextField = "usr_id" DataValueField = "usr_PK" runat="server" ></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
View 3 Replies
Jun 25, 2010
I found code [URL] that allows multiple-row inserts, and tried to convert it to vb.net. I can't get the blank grid with 5 rows to show up -- for some reason the datasource won't bind.
[Code]....
Code gridview:
[Code]....
View 4 Replies
Aug 22, 2010
i am using grid view when i define one of my culomns in sql data base as image then i can't put jpg image in that culomn so i can show this in grid view eather.
View 1 Replies
Nov 26, 2010
i have C# Winform program and i need to convert it to Webform. can i get any simple sample for how to show database grid on screen,
add new, update and delete ?
i try to show table on screen like this:
SQL = "SELECT * FROM MEN order by Lname";
dsView = new DataSet();
adp = new SqlDataAdapter(SQL, Conn);
adp.Fill(dsView, "MEN");
adp.Dispose();
GridView1.DataSource = dsView.Tables["MEN"].DefaultView;
View 1 Replies
May 21, 2012
Looking to show a confirm message when an IMAGEFIELD in my grid is clicked...something like this:
btn1.Attributes.Add("onclick", "return confirm('Are you sure?')")
View 1 Replies
Jul 9, 2010
how i can show Global resource file content (name , value , comment ) in grid view?and how i can Update(edit) it?
View 1 Replies