Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 11616 |  Welcome, Guest!   Register  Login
 Home > Forums > WPF > How to give Padding for Datagrid ...
Issac

How to give Padding for Datagrid

Replies: 6 | Posted by: Issac on 4/9/2012 | Category: WPF Forums | Views: 922 | Status: [Member] | Points: 10  


im using a DataGrid and i kept "Auto" for DataGridTextColumn
but 2nd column data is very near to 3rd column data..
it seems like both are combined....so i would like to give some padding 10px right to columns...
so that some difference will be there between each columns ...

can anyone help me ?


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Hariinakoti
Hariinakoti  
Posted on: 4/9/2012 5:00:54 AM
Level: Starter | Status: [Member] | Points: 25

hi issac,
u can create datagrid dynamically,then u can arrangements as u like.
try once.

Thanks & Regards
Hari

Issac, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Patel28rajendra
Patel28rajendra  
Posted on: 4/9/2012 5:07:32 AM
Level: Starter | Status: [Member] | Points: 25

Hi

you can apply css for that

for more details Refer this link

http://forums.asp.net/t/1303027.aspx/1

R D Patel

Issac, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Patel28rajendra
Patel28rajendra  
Posted on: 4/9/2012 5:08:32 AM
Level: Starter | Status: [Member] | Points: 25

Issac, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Rajni.Shekhar
Rajni.Shekhar  
Posted on: 4/9/2012 8:01:11 AM
Level: Bronze | Status: [Member] | Points: 25

Try it:

<head runat="server">

<title></title>
<style type="text/css">
TABLE.tabulardata TD {
PADDING:4px;
}
</style>

</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" CssClass="tabulardata">
</asp:GridView>
</div>
</form>
</body>
</html>


Thanks,
Rajni Shekhar

Issac, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Patel28rajendra
Patel28rajendra  
Posted on: 4/9/2012 9:24:01 AM
Level: Starter | Status: [Member] | Points: 25

Hi

Please Mark as Answer if it Helps

R D Patel

Issac, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Issac
Issac  
Posted on: 4/11/2012 1:00:15 AM
Level: Starter | Status: [Member] | Points: 25

Resolved

guys everyone gave answer for me for Gridview ...
but i asked for datagrid in wpf....
anyways i resolved it for myself...
thank u all....

answer is
set the value of padding in datagridtextcolumn element style for textbox

Issac, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/18/2013 3:40:36 PM