Custom Control size not set Under Datagrid

Nov 20, 2009 at 11:47 AM

    <dg:DataGrid AutoGenerateColumns="False"
                                 BorderThickness="1"
                                 BorderBrush="Black"
                                 Height="450"
                                 ItemsSource="{Binding Path=ObjItemType.ItemTypeDetails,
                                              Mode=Oneway}">

                     <dg:DataGridTemplateColumn Header="Account Name"  Width="175" MinWidth="175"
                                HeaderStyle="{DynamicResource LeftAlignedColumnHeaderStyle}">
                                <dg:DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <infra:LookupTextbox Style="{DynamicResource txtLookupEntry}"
                                                ObjectID="OBJ_ACCOUNT" Width="175"
                                                ReturnValue="{Binding Path=AccountCode ,
                                                        Mode=TwoWay,
                                                        UpdateSourceTrigger=LostFocus,
                                                        NotifyOnValidationError=True,
                                                        ValidatesOnDataErrors=True,
                                                        ValidatesOnExceptions=True}"/>
                                    </DataTemplate>
                                </dg:DataGridTemplateColumn.CellTemplate>
                            </dg:DataGridTemplateColumn>
                        </dg:DataGrid.Columns>
   </dg:DataGrid>

I have above code. data binding having no problem. but i given size of my user control Lookup textbox = 175 which is not taking.  its autofit as per text on it. if there is no text then it will 0 size. how to solve this?

Thanks in advance