How to give Padding for Datagrid [Resolved]

Posted by Issac under WPF on 4/9/2012 | Points: 10 | Views : 3725 | Status : [Member] | Replies : 6
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 ?




Responses

Posted by: Issac on: 4/11/2012 [Member] Starter | Points: 25

Up
0
Down

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. | Alert Moderator

Posted by: Hariinakoti on: 4/9/2012 [Member] Starter | Points: 25

Up
0
Down
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. | Alert Moderator

Posted by: Patel28rajendra on: 4/9/2012 [Member] Starter | Points: 25

Up
0
Down
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. | Alert Moderator

Posted by: Patel28rajendra on: 4/9/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

For callspadding property see this link

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.cellpadding.aspx

R D Patel

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

Posted by: Rajni.Shekhar on: 4/9/2012 [Member] Bronze | Points: 25

Up
0
Down
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. | Alert Moderator

Posted by: Patel28rajendra on: 4/9/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

Please Mark as Answer if it Helps

R D Patel

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

Login to post response