• Jueves 28 de Marzo de 2024, 19:22

Autor Tema:  agregar valor de fecha en GridDateTimeColumn  (Leído 1899 veces)

alexisgondola

  • Miembro activo
  • **
  • Mensajes: 37
  • Nacionalidad: pa
    • Ver Perfil
agregar valor de fecha en GridDateTimeColumn
« en: Miércoles 27 de Junio de 2012, 03:56 »
0
buenas tardes que tal, tengo la siguiente consulta, en mi grid de telerik tengo la siguiente columna
, al realizar la consulta se muestra el valor de la fecha

deseo que cuando el usuario presione el boton nuevo que se encuentra en el grid, cuando me aparesca la nueva fila me aparesca asignado el valor de la fecha esta fecha

como lo e echo en un ejemplo con una caja de fechas de telerik

quiero hacer algo asi:
 dpFecha.MinDate = Convert.ToDateTime(dpFechaInicio.SelectedDate);
 
 dpFecha.MaxDate = Convert.ToDateTime(dpFechaFin.SelectedDate);


<telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None"
            AutoGenerateColumns="False" PageSize="7" AllowSorting="True" AllowPaging="True" OnItemUpdated="RadGrid1_ItemUpdated"
            OnUpdateCommand="RadGrid1_UpdateCommand" OnNeedDataSource="RadGrid1_NeedDataSource"
            ShowStatusBar="True" OnInsertCommand="RadGrid1_InsertCommand"  OnDataBound="RadGrid1_DataBound" OnItemDataBound = "RadGrid1_ItemDataBound"
                                     OnDeleteCommand="RadGrid1_DeleteCommand" 
                                   Skin="Windows7" CellSpacing="0" >                         
            <MasterTableView DataKeyNames="id_reporte" AllowMultiColumnSorting="True" Width="100%"   CommandItemDisplay="Top">
             
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>

<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
                <Columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                    <ItemStyle CssClass="MyImageButton" />
                </telerik:GridEditCommandColumn>

                    <telerik:GridDateTimeColumn UniqueName="f_tarea" SortExpression="f_tarea" HeaderText="Fecha"
                        DataField="f_tarea" DataFormatString="{0:d}" DataType="System.DateTime" >

                        <HeaderStyle Width="100px" />

                    </telerik:GridDateTimeColumn>


                <telerik:GridButtonColumn ConfirmText="Elimar ?" ConfirmDialogType="RadWindow"
                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                    UniqueName="DeleteColumn">
                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                </telerik:GridButtonColumn>

                </Columns>
                <EditFormSettings CaptionFormatString="editar " CaptionDataField="id_reporte">
                    <FormTableItemStyle Width="100%" Height="29px"></FormTableItemStyle>
                    <FormTableStyle GridLines="None" CellSpacing="0" CellPadding="2"></FormTableStyle>
                    <FormStyle Width="100%" BackColor="#eef2ea"></FormStyle>
                    <EditColumn ButtonType="ImageButton" />
                </EditFormSettings>
            </MasterTableView>

        <ClientSettings>
<Selecting AllowRowSelect="true"></Selecting>

            <ClientEvents OnRowDblClick="RowDblClick" />
        </ClientSettings>

<FilterMenu EnableImageSprites="False"></FilterMenu>
        </telerik:RadGrid>
todos los dias se aprende algo nuevo