Click here to Skip to main content
15,740,731 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

Please tell me how to add two datagrid column in as a single column
e.g.
i have one column Item whose width=60
and another i have Set whose width=40

So i want to add the width of the Set Column to Item column.
So item column will become 100

Please tell me how to do that..

Thank you
Posted

1 solution

See this one


<window>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing" xmlns:local="clr-namespace:WpfStepByStep1" mc:Ignorable="d"
x:Class="WpfStepByStep1.MainWindow"
x:Name="Window"
Title="reponsive" Height="600" Width="825" ResizeMode="CanResizeWithGrip" >


<window.datacontext>
<local:addressbookviewmodel x:name="ViewModel" xmlns:x="#unknown" xmlns:local="#unknown">




<grid x:name="LayoutRoot" xmlns:x="#unknown">
<textblock horizontalalignment="Left" margin="8,8,0,0" textwrapping="Wrap" text="Address Book" verticalalignment="Top">
<listbox x:name="___No_Name_" margin="8,62,0,65" horizontalalignment="Left" width="213" itemssource="{Binding Contacts}" selecteditem="{Binding SelectedContact}" displaymemberpath="Name"> <textblock horizontalalignment="Left" margin="237,62,0,0" textwrapping="Wrap" text="Address Book" verticalalignment="Top">
<textblock horizontalalignment="Left" margin="238,119,0,0" textwrapping="Wrap" text="Name" verticalalignment="Top">
<textbox horizontalalignment="Right" margin="0,116,44.446,0" textwrapping="Wrap" text="{Binding SelectedContact.Name}" verticalalignment="Top" width="226.553">
<textblock horizontalalignment="Left" margin="238,144.96,0,0" textwrapping="Wrap" text="E-Mail" verticalalignment="Top">
<textbox horizontalalignment="Right" margin="0,141.96,44.446,0" textwrapping="Wrap" text="{Binding SelectedContact.Email}" verticalalignment="Top" width="226.553">
<textblock horizontalalignment="Left" margin="238,170.92,0,0" textwrapping="Wrap" text="Phone" verticalalignment="Top">
<textbox horizontalalignment="Right" margin="0,167.92,44.446,0" textwrapping="Wrap" text="{Binding SelectedContact.PhoneNumber}" verticalalignment="Top" width="226.553">


<textbox height="23" horizontalalignment="Left" margin="532,207,0,0" name="textBox1" verticalalignment="Top" width="227">

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900