Hi,
I can edit radgrid In Forms Editing Mode, then I can update all columns but I have problem with one column. "HİZMET KODU" column like "Products" have many items so user have to select on modal products form, instead of write product name manually. I can not open radwindow on RadGrid. On the screenshot , I only open javascript modal window, but ı cant set value from this modal form to the radgrid edit form textbox. Are there any example for this situation ?
http://img393.imageshack.us/my.php?image=telerikkh4.jpg
Here is the source code:
<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Inox" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" Width="97%" OnNeedDataSource="RadGrid1_NeedDataSource"
AllowAutomaticDeletes="True" AllowAutomaticUpdates="True"
OnDeleteCommand="RadGrid1_DeleteCommand" OnInsertCommand="RadGrid1_InsertCommand"
OnUpdateCommand="RadGrid1_UpdateCommand" OnDataBound="RadGrid1_DataBound" OnItemCreated="RadGrid1_ItemCreated" >
<PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
<MasterTableView DataKeyNames="ORLREF" GridLines="None" Width="100%" CommandItemDisplay ="Top" >
<Columns>
<telerik:GridButtonColumn ConfirmText="Delete this product?" ButtonType="ImageButton"
ImageUrl="images/Delete.gif" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
<ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
</telerik:GridButtonColumn>
<telerik:GridBoundColumn DataField="ORLREF" HeaderText="REF NO." UniqueName="ORLREF" ReadOnly="True">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="HİZMET KODU" UniqueName="CODE">
<EditItemTemplate>
<telerik:RadTextBox ID="textbox1" runat="server" Text='<%# Bind("CODE")%>'></telerik:RadTextBox>
<asp:Button Runat="server" ID="ServerButton" Text="Show dialog" cssclass="button" style="width:250px;" OnClick="ServerButton_Click"></asp:Button>
</EditItemTemplate>
<ItemTemplate>
<%#Eval("CODE")%>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="DEFINITION_" HeaderText="AÇIKLAMASI" UniqueName="DEFINITION_">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="AMOUNT" HeaderText="MİKTAR" UniqueName="AMOUNT">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="PRICE" HeaderText="BİRİM FİYAT" UniqueName="PRICE">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="KDV DAHİL/HARİÇ" UniqueName="KDV">
<EditItemTemplate>
<telerik:RadComboBox ID="RadComboBox1" AppendDataBoundItems="true" Height="200px" runat="server"
DataTextField="KDV" DataValueField="KDV" SelectedValue='<%# Bind("KDV")%>'>
<Items>
<telerik:RadComboBoxItem Text="" Value="" />
<telerik:RadComboBoxItem Text="Hariç" Value="HARİÇ" />
<telerik:RadComboBoxItem Text="Dahil" Value="DAHİL" />
</Items>
</telerik:RadComboBox>
</EditItemTemplate>
<ItemTemplate>
<%#Eval("KDV")%>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="VAT" HeaderText="KDV ORANI" UniqueName="VAT">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="TOTAL" HeaderText="TUTAR" UniqueName="TOTAL" ReadOnly="True">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="SPECODE" HeaderText="FATURALANACAK" UniqueName="SPECODE">
</telerik:GridBoundColumn>
<telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>
</Columns>
<EditFormSettings ColumnNumber="2" CaptionFormatString="Satırı Düzenle {0}" CaptionDataField="LOGICALREF">
<FormTableItemStyle Wrap="False"></FormTableItemStyle>
<FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
<FormMainTableStyle CellSpacing="0" CellPadding="3" Width="100%" />
<FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" CssClass="module" Height="110px" Width="100%" />
<FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
<FormStyle Width="100%" BackColor="#EEF2EA"></FormStyle>
<EditColumn UpdateText="Güncelle" UniqueName="EditCommandColumn1" CancelText="Düzenlemekten Vazgeç">
</EditColumn>
<FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
</EditFormSettings>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<RowIndicatorColumn>
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<CommandItemSettings AddNewRecordText="Yeni Kayıt Ekle" />
</MasterTableView>
</telerik:RadGrid>
CodeBehind Source Code
protected
void ServerButton_Click(object sender, EventArgs e)
{
string popupScript = "<script language='javascript'>" +
"window.showModalDialog('SrvCards.aspx', 'CustomPopUp','dialogWidth:255px;dialogHeight:250px;scrollbars=yes'); " +
"</script>";
Page.RegisterStartupScript(
"PopupScript", popupScript);
}