Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
220 views

I  created grid dynamically and placed button on the page.It is working fine except column width when i browse the page first time.
 I am also  displaying seach conditions in RadWindow when user clicks on button.
Note : I created xml file for columns definations and using to generate the bound columns.

1. I am getting extra columns when i click on pager to selct particular page or  column for sort.This is exactly the same number of columns in the grid.
   Let assume, I am displaying 5 columns in grid. It is displaying 10 columns after i clicked on paging or sorting, third time 15 and so on. I am not really sure how and where these columns are creating. the value in extra columns is System.Data.DataRowView.

2.4. I am getting the popup with retry and cancel buttons with the below message when i seach the records other than first page or before selecting the column sort or paging. Can you please advice me on this?
 
To Display the webpage again, Internet Explorer needs to resend the information you've previously submited

If you were making a purchase, you should click Cancel to avoid a duplicate transaction. Otherwise, click Retry to display the webpage again.

3. the sort image is coming second line when i click on column for sort. Can please help me to fix this issue?
4. Select Column with is very large when i browse the first time. But it is adjusting the column width automatically after i click on paging or sorting. Can please help me to fix this issue?

5. I set EnableAjax = true but still it is doing post back. Can please help me to fix this issue?

I pasted code below because i didn't see any buttom for file attachment.

Page 1:
HTML :

<%

@ Page Language="C#" MasterPageFile="~/DealerFinance.master" AutoEventWireup="true" CodeFile="DealerList.aspx.cs" Inherits="Dealer_DealerList" Title="Untitled Page" %>

<%

@ MasterType VirtualPath="~/DealerFinance.master" %>

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<

asp:Content ID="Content2" ContentPlaceHolderID="DealerFinancePlaceHolder" Runat="Server">

<

script language="javascript" type="text/javascript">

function LookupParameter()

{

var popWin = window.open('DealersSearch.aspx','SearchDealer','width=400,height=350,top=100,toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no,resizable=yes,left=200','');

// window.open('/DealersFinanceApplication/Dealer/DealersSearch.aspx', 'Sai', '','');

popWin.focus();

return false;

}

function ParentFormPostBack()

{

__doPostBack(

'btnSearch','');

}

</

script>

 

<table>

<tr>

<td align="left">

<!-- <asp:Button ID="tempbtnSearch" runat="server" CausesValidation="false" OnClientClick="LookupParameter()" SkinID="DisplayButton"

Text="Search" /> -->

<asp:Button ID="btnSearch" runat="server" CausesValidation="false" SkinID="DisplayButton"

Text="Search" />

&nbsp;

</td>

</tr>

<tr>

<td>

<telerik:RadGrid ID="grdDealerList" runat="server" AllowSorting="true" ItemStyle-BackColor= "AliceBlue" AlternatingItemStyle-BackColor="#ffffff" GridLines="None">

</telerik:RadGrid>

<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>

</td>

</tr>

</table>

<telerik:radwindow openerelementid="<%# btnSearch.ClientID %>" navigateurl="DealersSearch.aspx"

runat="server" width="400px" height="450px" id="Radwindow4" visiblestatusbar="false"

skin="Mac"></telerik:radwindow>

</

asp:Content>

codebehind:

using

System;

using

System.Collections;

using

System.Configuration;

using

System.Data;

using

System.Linq;

using

System.Web;

using

System.Web.Security;

using

System.Web.UI;

using

System.Web.UI.HtmlControls;

using

System.Web.UI.WebControls;

using

System.Web.UI.WebControls.WebParts;

using

System.Xml.Linq;

using

Telerik.Web.UI;

using

System.Data.SqlClient;

using

System.Xml;

using

System.Drawing;

public

partial class Dealer_DealerList : System.Web.UI.Page

{

public string searchCondition = "";

protected void Page_Load(object sender, EventArgs e)

{

if (!IsPostBack)

{

Master.SelectedDealerTab = 1;

//DealSearchFields dealerSeachFieldsObj = (DealSearchFields)Session["DealerSearchFields"];

//if (dealerSeachFieldsObj != null)

//{

// searchCondition = dealerSeachFieldsObj.DealerNumber;

//}

//else

//{

// searchCondition = "";

//}

//btnSearch.Attributes.Add("onclick", "return LookupParameter();");

//Dynaic code for Rad Grid Starts here

 

}

 

}

protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

{

grdDealerList.DataSource = BindGrid();

}

private DataTable BindGrid()

{

string searchCondition = "";

DealSearchFields dealerSeachFieldsObj = (DealSearchFields)Session["DealerSearchFields"];

if (dealerSeachFieldsObj != null)

{

searchCondition = dealerSeachFieldsObj.DealerNumber;

}

else

{

searchCondition =

"";

}

string sql = "SELECT ROW_ID ,DEALER_NUM ,NAME, LEGAL_NAME, SALES_DISTRICT, BUSINESS_TYPE FROM KF_DEALER where DEALER_NUM LIKE '%" + searchCondition + "%' order by DEALER_NUM";

SqlDataAdapter adapter = new SqlDataAdapter(sql,

ConfigurationManager.ConnectionStrings["KC_DealerFinanceConnectionString"].ConnectionString);

DataTable dt = new DataTable();

adapter.Fill(dt);

return dt;

}

protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)

{

if (e.CommandName == "Select")

{

GridDataItem dataItem = (GridDataItem)e.Item;

string strTxt = dataItem.GetDataKeyValue("DEALER_NUM").ToString();

string rowID = dataItem.GetDataKeyValue("ROW_ID").ToString();

Response.Redirect(

"/DealersFinanceApplication/Dealer/DealerDetails.aspx");

}

 

 

}

protected void Page_Init(object sender, System.EventArgs e)

{

DefineGridStructure();

}

 

private void DefineGridStructure()

{

bool isFromWindow = Convert.ToBoolean(Session["IsFromWindow"]);

//RadGrid grdDealerList = new RadGrid();

//grdDealerList.ID = "RadGrid1";

if (isFromWindow)

{

grdDealerList.DataSource =

"";

grdDealerList.Rebind();

}

grdDealerList.NeedDataSource +=

new GridNeedDataSourceEventHandler(this.RadGrid1_NeedDataSource);

grdDealerList.ItemCommand +=

new GridCommandEventHandler(this.RadGrid1_ItemCommand);

//grdDealerList.DataSource = BindGrid();

grdDealerList.Skin =

"Inox";

//grdDealerList.Width = Unit.Percentage(100);

grdDealerList.PageSize = 5;

grdDealerList.AllowPaging =

true;

grdDealerList.PagerStyle.Mode =

GridPagerMode.NextPrevAndNumeric;

grdDealerList.AutoGenerateColumns =

false;

//grdDealerList.GroupingEnabled = true;

//grdDealerList.ShowGroupPanel = true;

grdDealerList.ShowStatusBar =

true;

grdDealerList.ClientSettings.AllowDragToGroup =

true;

grdDealerList.AllowSorting =

true;

grdDealerList.Width =

Unit.Percentage(100);

grdDealerList.ItemStyle.CssClass =

"RadGrid";

grdDealerList.MasterTableView.PageSize = 30;

grdDealerList.MasterTableView.DataKeyNames =

new string[] { "ROW_ID", "DEALER_NUM" };

GridButtonColumn selectColumn = new GridButtonColumn();

selectColumn.DataTextField =

"DEALER_NUM";

selectColumn.CommandArgument =

"DEALER_NUM";

selectColumn.CommandName =

"Select";

selectColumn.HeaderText =

"DealerNumber";

selectColumn.DataTextFormatString =

"<nobr>{0}</nobr>";

selectColumn.SortExpression =

"DEALER_NUM";

//selectColumn.

grdDealerList.MasterTableView.Columns.Add(selectColumn);

 

XmlDocument xmlDoc = new XmlDocument();

xmlDoc.Load(Request.MapPath(

"~/App_Data/DataMapping.xml"));

XmlNodeList columnNodeList = XML.GetNodeList("/DealerGrids/DealerGrid[@Name ='DealerList']/Columns/Column", xmlDoc);

 

foreach (XmlNode columnNode in columnNodeList)

{

string headerText = "";

headerText =

XML.GetAttributeValue("/Column", "DisplayText", columnNode.OuterXml);

if (headerText != null && headerText.Length > 0)

{

GridBoundColumn boundColumn = new GridBoundColumn();

boundColumn.DataField =

XML.GetAttributeValue("/Column", "TableColumnName", columnNode.OuterXml);

boundColumn.HeaderText = headerText;

boundColumn.DataFormatString =

"<nobr>{0}</nobr>";

grdDealerList.MasterTableView.Columns.Add(boundColumn);

}

}

this.PlaceHolder1.Controls.Add(grdDealerList);

if (isFromWindow)

{

grdDealerList.DataSource = BindGrid();

grdDealerList.Rebind();

}

Session[

"IsFromWindow"] = false;

}

 

//public readonly RadGrid DealerListGrid

//{

// get

// {

// return grdDealerList;

// }

//}

}

Page 2(Which i am displaying in radwindow)

<%

@ Page Language="C#" AutoEventWireup="true" CodeFile="DealersSearch.aspx.cs" Inherits="Dealer_DealersSearch" %>

 

<!

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<

html xmlns="http://www.w3.org/1999/xhtml">

<

head runat="server">

 

<title><%=Resources.DealerFinance.DealerSearchHeader%></title>

 

<script language="javascript" type="text/javascript">

 

//This code is used to provide a reference to the radwindow "wrapper"

 

function GetRadWindow()

{

var oWindow = null;

if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog

 

else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz az well)

 

return oWindow;

}

function CloseOnReloadandReLoad()

{

RefreshParentPage();

//GetRadWindow().Close();

 

}

function CloseOnReload()

{

GetRadWindow().Close();

}

 

function RefreshParentPage()

{

GetRadWindow().BrowserWindow.location.reload();

}

function SelectAgency(code, name)

{

window.close();

window.opener.ParentFormPostBack(

'','');

window.opener.focus();

}

</script>

 

 

</

head>

<

body>

 

<form id="form1" runat="server">

 

<asp:Label ID="InjectScript" runat="server"></asp:Label>

 

<table>

 

<tr>

 

<td align="center" nowrap="nowrap" colspan="3" >

 

<div class="TitleTextNormal"> <%=Resources.DealerFinance.DealerSearchHeader%> </div>

 

</td>

 

</tr>

 

<tr>

 

<td height="10px" align="center" nowrap="nowrap" colspan="3" >

 

</td>

</tr>

 

<tr>

 

<td align="right" nowrap="nowrap">

 

<%

=Resources.DealerFinance.LegalName%>

</td>

 

<td align="left">

 

<asp:TextBox ID="txtLegalName" TabIndex="100" runat="server" MaxLength="30" size="30" ></asp:TextBox>

 

</td>

 

<td align="right" width="10px">

 

</td>

 

</tr>

 

<tr>

 

<td align="right" nowrap="nowrap">

 

<%

=Resources.DealerFinance.DBAName%>

</td>

 

<td align="left">

 

<asp:TextBox ID="txtDBAName" TabIndex="101" runat="server" MaxLength="30" size="30"></asp:TextBox>

 

</td>

 

<td align="right" width="10px">

 

</td>

 

</tr>

 

<tr>

 

<td align="right" nowrap="nowrap">

 

<%

=Resources.DealerFinance.KawasakiName%>

</td>

 

<td align="left">

 

<asp:TextBox ID="txtKawasakiName" TabIndex="102" runat="server" MaxLength="30" size="30"></asp:TextBox>

 

</td>

 

<td align="right" width="10px">

 

</td>

 

</tr>

 

<tr>

 

<td align="right" nowrap="nowrap">

 

<%

=Resources.DealerFinance.Address%>

</td>

 

<td align="left">

 

<asp:TextBox ID="txtAddress" TabIndex="103" runat="server" MaxLength="30" size="30"></asp:TextBox>

 

</td>

 

<td align="right" width="10px">

 

</td>

 

</tr>

 

<tr>

 

<td align="right" nowrap="nowrap">

 

<%

=Resources.DealerFinance.City%>

</td>

 

<td align="left">

 

<asp:TextBox ID="txtCity" TabIndex="104" runat="server" MaxLength="30" size="20"></asp:TextBox>

 

</td>

 

<td align="right" width="10px">

 

</td>

 

</tr>

 

<tr>

 

<td align="right" nowrap="nowrap">

 

<%

=Resources.DealerFinance.State%>

</td>

 

<td align="left">

 

<asp:TextBox ID="txtState" TabIndex="105" runat="server" MaxLength="10" size="10"></asp:TextBox>

 

</td>

 

<td align="right" width="10px">

 

</td>

 

</tr>

 

<tr>

 

<td align="right" nowrap="nowrap">

 

<%

=Resources.DealerFinance.Zip%>

</td>

 

<td align="left">

 

<asp:TextBox ID="txtZip" TabIndex="106" runat="server" MaxLength="10" size="10"></asp:TextBox>

 

</td>

 

<td align="right" width="10px">

 

</td>

 

</tr>

 

<tr>

 

<td align="right" nowrap="nowrap">

 

<%

=Resources.DealerFinance.PrincipalLastName%>

</td>

 

<td align="left">

 

<asp:TextBox ID="txtPrincipalLastName" TabIndex="107" runat="server" MaxLength="30"

 

size="30"></asp:TextBox>

 

</td>

 

<td align="right" width="10px">

 

</td>

 

</tr>

 

<tr>

 

<td align="right" nowrap="nowrap">

 

<%

=Resources.DealerFinance.PrincipalSSN%>

</td>

 

<td align="left">

 

<asp:TextBox ID="txtPrincipalSSN" TabIndex="108" runat="server" MaxLength="10" size="10"></asp:TextBox>

 

</td>

 

<td align="right" width="10px">

 

</td>

 

</tr>

 

<tr>

 

<td align="right" nowrap="nowrap">

 

<%

=Resources.DealerFinance.DealerNumber%>

</td>

 

<td align="left">

 

<asp:TextBox ID="txtDealerNumber" TabIndex="109" runat="server" MaxLength="10" size="10"></asp:TextBox>

 

</td>

 

<td align="right" width="10px">

 

</td>

 

</tr>

 

<tr>

 

<td align="center" colspan="2">

 

<br />

 

<!-- <asp:Button ID="btnSearch" runat="server" CausesValidation="false" OnClick="btnSearch_Click"

SkinID="DisplayButton" Text="Search" OnClientClick="SelectAgency()" /> -->

 

<asp:Button ID="Button1" runat="server" CausesValidation="false" OnClick="btnSearch_Click"

 

SkinID="DisplayButton" Text="Search" />

 

<asp:Button ID="btnCancel" runat="server" CausesValidation="false" OnClick="btnCancel_Click"

 

SkinID="DisplayButton" Text="Cancel" />

 

</td>

 

<td align="right" width="10px">

 

</td>

 

</tr>

 

</table>

 

</form>

</

body>

</

html>

code behind:

using

System;

using

System.Collections;

using

System.Configuration;

using

System.Data;

using

System.Linq;

using

System.Web;

using

System.Web.Security;

using

System.Web.UI;

using

System.Web.UI.HtmlControls;

using

System.Web.UI.WebControls;

using

System.Web.UI.WebControls.WebParts;

using

System.Xml.Linq;

using

Telerik.Web.UI;

public

partial class Dealer_DealersSearch : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

//Teleric

this.Page.DataBind();

}

protected void btnSearch_Click(object sender, EventArgs e)

{

DealSearchFields dealerSearchFileldsObj = new DealSearchFields();

dealerSearchFileldsObj.LegalName = txtLegalName.Text;

dealerSearchFileldsObj.DBAName = txtDBAName.Text;

dealerSearchFileldsObj.KawasakiName = txtKawasakiName.Text;

dealerSearchFileldsObj.Address = txtAddress.Text;

dealerSearchFileldsObj.City = txtCity.Text;

dealerSearchFileldsObj.State = txtState.Text;

dealerSearchFileldsObj.Zip = txtZip.Text;

dealerSearchFileldsObj.PrincipalLastName = txtPrincipalLastName.Text;

dealerSearchFileldsObj.PrincipalSSN = txtPrincipalSSN.Text;

dealerSearchFileldsObj.DealerNumber = txtDealerNumber.Text;

//

Session[

"DealerSearchFields"] = dealerSearchFileldsObj;

Session[

"IsFromWindow"] = true;

//Teleric

InjectScript.Text =

"<script>CloseOnReloadandReLoad()</" + "script>";

}

protected void btnCancel_Click(object sender, EventArgs e)

{

//Teleric

InjectScript.Text =

"<script>CloseOnReload()</" + "script>";

}

}

Master Page:

 

@ Master Language="C#" AutoEventWireup="true" CodeFile="DealerFinance.master.cs" Inherits="DealerFinance"

%>

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik"

%>

 

html xmlns

="http://www.w3.org/1999/xhtml">

head runat

="server">

 

<title>Untitled Page</title

>

 

<link href="App_Themes/DealerFinance/DealerFinance.css" rel="Stylesheet" type="text/css"

/>

 

<link href="JavaScript/DealerFinance.js" type="text/javascript"

/>

 

<asp:ContentPlaceHolder ID="head" runat

="server">

 

</asp:ContentPlaceHolder

>

head

>

body

>

 

<form id="form1" runat

="server">

 

<telerik:RadScriptManager ID="RadScriptManager1" runat

="server">

 

</telerik:RadScriptManager

>

 

<table

>

 

<tr

>

 

<td

>

 

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" BorderColor

="Silver">

 

<telerik:RadTabStrip ID="rtsDealerMenu" runat="server" Skin="Web20" SelectedIndex

="0">

 

</telerik:RadTabStrip

>

 

</telerik:RadAjaxPanel

>

 

</td

>

 

</tr

>

 

<tr

>

 

<td

>

 

<asp:ContentPlaceHolder ID="DealerFinancePlaceHolder" runat

="server">

 

</asp:ContentPlaceHolder

>

 

</td

>

 

</tr

>

 

</table

>

 

</form

>

body

>

html

>

Master Page Code behind :

Yavor
Telerik team
 answered on 15 Sep 2008
1 answer
202 views
Hi
I'm trying to extract information from a dbase into the rotator. This is the code i have so far:

Imports System
Imports System.Data
Imports System.Data.OleDb
Imports System.Drawing
Imports Telerik.Web.UI
Imports System.Collections.Generic
Partial Class fullview
    Inherits System.Web.UI.Page
    Private Structure fileInfo
        Public Url As String
        Public Image As String
          End Structure

    Private Property imagesArray() As List(Of fileInfo)
        Get
            Return DirectCast(ViewState("imagesArray"), List(Of fileInfo))
        End Get
        Set(ByVal value As List(Of fileInfo))
            ViewState("imagesArray") = value
        End Set
    End Property
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim rotatorData As New DataTable()
        rotatorData.Columns.Add("URL")
        rotatorData.Columns.Add("Image")
        Dim conn As Data.SqlClient.SqlConnection
        Dim cmd As Data.SqlClient.SqlCommand
        Dim reader As Data.SqlClient.SqlDataReader
        conn = New Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings.Item(1).ToString)

        Dim gal, photo, urli As String
        urli = Request.QueryString("galleryName")
        'temp = urli.Substring(urli.IndexOf("=") + 1, (urli.IndexOf("&")) - (urli.IndexOf("=") + 1))
        gal = urli.Replace("%20", " ")
        urli = Request.QueryString("photo")
        photo = urli.Replace("%20", " ")
        Response.Write(urli & gal & photo)
        conn.Open()
        cmd = New Data.SqlClient.SqlCommand("select * from Gallery where GalleryName='" & gal & "' and UserID=" & Session("uid"), conn)
        imagesArray = New List(Of fileInfo)()

        reader = cmd.ExecuteReader

        If (reader.HasRows) Then

            While (reader.Read())

                Dim fInfo As New fileInfo()
                fInfo.Url = "<a href=" & Chr(34) & "javascript:ajaxpage('fullview.aspx?galleryname=" & gal & "&photo=" & Trim(reader("PictureURL").ToString) & "','contentarea')" & Chr(34) & ">"
                fInfo.Image = "'images/users/" & Session("uid") & "/" & gal & "/Thumbnails/" & Trim(reader("PictureURL").ToString) & "'"

                imagesArray.Add(fInfo)
            End While
      
        End If
        RebindRotator()

    End Sub
    Private Sub RebindRotator()
        Dim rotatorData As New DataTable()
        rotatorData.Columns.Add("Url")
        rotatorData.Columns.Add("Image")
        For Each tempInfo As fileInfo In imagesArray
            rotatorData.Rows.Add(New String() {tempInfo.Url, tempInfo.Image})
        Next

        RadRotator1.DataSource = rotatorData()
        RadRotator1.DataBind()
    End Sub

End Class

and the aspx:

 <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        OutputCompression="AutoDetect">
    </telerik:RadScriptManager>
  
        <telerik:RadRotator ID="RadRotator1" runat="server">
         <ItemTemplate>
      <a href="<%# DataBinder.Eval(Container.DataItem, "URL") %>"><img src="<%# DataBinder.Eval(Container.DataItem, "Image") %>"</a>
   </ItemTemplate>
        </telerik:RadRotator>
        <br />

The error i get is:

Server Error in '/profiles' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30367: Class 'System.Data.DataTable' cannot be indexed because it has no default property.

Source Error:


Line 65:         Next
Line 66:
Line 67: RadRotator1.DataSource = rotatorData()
Line 68: RadRotator1.DataBind()
Line 69: End Sub

I was hoping that since i gleaned this tactic from one of your examples, you might be able to help me with that, since i'm not having much luck on the net.
Thanks in advance.
Georgi Tunev
Telerik team
 answered on 15 Sep 2008
0 answers
126 views
When querying the rotator for the current item outside a clientside event handler the get_currentItem() returns the DOM element instead of a RadRotatorItem object.

var rotator = <%# radRotator1.ClientID %>.control;
var currentItem = rotator.get_currentItem();

This only gets a reference to the current listitem (LI)

var currentItem = rotator.get_currentItem().control;
var currentItem = rotator.get_currentItem()._item;

These do get references to the RadRotatorItem object
J-P Minderhoud
Top achievements
Rank 1
 asked on 15 Sep 2008
1 answer
133 views
I have a ComboBox with a template defined at design-time.  The control is bound to a SqlDataSource, also defined at design-time.  What I want to do is insert an item after the control is bound to the datasource (so, in the OnDataBound event).

I can insert a new item, but this new item doesn't contain any of the additional fields/values that the databound items have.  I thought I could add the fields as attributes, but that didn't work.  I'm sure this must be possible, but cannot figure it out or find the solution... what's the trick?
Yana
Telerik team
 answered on 15 Sep 2008
1 answer
261 views
Hi,
 
                I  created grid dynamically and paced button on page.It is working fine except column width when i browse the page first time.
                I am also  displaying seach conditions in RadWindow when user clicks on button.

Note : I created xml file for columns definations and using to generate the bound columns.

Can you please help me to resolve the below issues?

Issues List :
               1. I am getting extra columns when i click on pager to selct particular page or  column for sort.
               2. I want to sort the records within the page not on data source, Is there any way we can sort the records present in the page?
              3. How can we set the column width in RadGrid?
              4. I am getting the popup with retry and cancel buttons with the below message when i seach the records other than first page or before selecting the column sort or paging. Can you please advice me on this?
  
To Display the webpage again, Internet Explorer needs to resend the information you've previously submited

If you were making a purchase, you should click Cancel to avoid a duplicate transaction. Otherwise, click Retry to display the webpage again.


HTML :

<%

@ Page Language="C#" MasterPageFile="~/DealerFinance.master" AutoEventWireup="true" CodeFile="DealerList.aspx.cs" Inherits="Dealer_DealerList" Title="Untitled Page" %>

<%

@ MasterType VirtualPath="~/DealerFinance.master" %>

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<

asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

</

asp:Content>

<

asp:Content ID="Content2" ContentPlaceHolderID="DealerFinancePlaceHolder" Runat="Server">

<table>

<tr>

<td align="left">

<asp:Button ID="btnSearch" runat="server" CausesValidation="false" SkinID="DisplayButton"

Text="Search" />

&nbsp;

</td>

</tr>

<tr>

<td>

<telerik:RadGrid ID="grdDealerList" runat="server" >

</telerik:RadGrid>

<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>

</td>

</tr>

</table>

<telerik:radwindow openerelementid="<%# btnSearch.ClientID %>" navigateurl="DealersSearch.aspx"

runat="server" width="400px" height="350px" id="Radwindow4" visiblestatusbar="false"

skin="Mac"></telerik:radwindow>

</

asp:Content>

ASPX :

using

System;

using

System.Collections;

using

System.Configuration;

using

System.Data;

using

System.Linq;

using

System.Web;

using

System.Web.Security;

using

System.Web.UI;

using

System.Web.UI.HtmlControls;

using

System.Web.UI.WebControls;

using

System.Web.UI.WebControls.WebParts;

using

System.Xml.Linq;

using

Telerik.Web.UI;

using

System.Data.SqlClient;

using

System.Xml;

public

partial class Dealer_DealerList : System.Web.UI.Page

{

public string searchCondition = "";

protected void Page_Load(object sender, EventArgs e)

{

if (!IsPostBack)

{

Master.SelectedDealerTab = 1;

DealSearchFields dealerSeachFieldsObj = (DealSearchFields)Session["DealerSearchFields"];

if (dealerSeachFieldsObj != null)

{

searchCondition = dealerSeachFieldsObj.DealerNumber;

}

else

{

searchCondition =

"";

}

}

 

}

protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

{

grdDealerList.DataSource = BindGrid();

}

private DataTable BindGrid()

{

string sql = "SELECT ROW_ID ,DEALER_NUM ,NAME, LEGAL_NAME, SALES_DISTRICT, BUSINESS_TYPE FROM KF_DEALER where DEALER_NUM LIKE '%" + searchCondition + "%' order by DEALER_NUM";

SqlDataAdapter adapter = new SqlDataAdapter(sql,

ConfigurationManager.ConnectionStrings["KC_DealerFinanceConnectionString"].ConnectionString);

DataTable dt = new DataTable();

adapter.Fill(dt);

return dt;

}

protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)

{

if (e.CommandName == "Select")

{

GridDataItem dataItem = (GridDataItem)e.Item;

string strTxt = dataItem.GetDataKeyValue("DEALER_NUM").ToString();

string rowID = dataItem.GetDataKeyValue("ROW_ID").ToString();

Response.Redirect(

"DealerDetails.aspx");

}

 

 

}

protected void Page_Init(object sender, System.EventArgs e)

{

DefineGridStructure();

}

 

private void DefineGridStructure()

{

//RadGrid grdDealerList = new RadGrid();

//grdDealerList.ID = "RadGrid1";

grdDealerList.NeedDataSource +=

new GridNeedDataSourceEventHandler(this.RadGrid1_NeedDataSource);

grdDealerList.ItemCommand +=

new GridCommandEventHandler(this.RadGrid1_ItemCommand);

//grdDealerList.DataSource = BindGrid();

grdDealerList.Skin =

"Inox";

//grdDealerList.Width = Unit.Percentage(100);

grdDealerList.PageSize = 5;

grdDealerList.AllowPaging =

true;

grdDealerList.PagerStyle.Mode =

GridPagerMode.NextPrevAndNumeric;

grdDealerList.AutoGenerateColumns =

false;

//grdDealerList.GroupingEnabled = true;

//grdDealerList.ShowGroupPanel = true;

grdDealerList.ShowStatusBar =

true;

grdDealerList.ClientSettings.AllowDragToGroup =

true;

grdDealerList.AllowSorting =

true;

grdDealerList.Width =

Unit.Percentage(100);

 

grdDealerList.MasterTableView.PageSize = 15;

grdDealerList.MasterTableView.DataKeyNames =

new string[] { "ROW_ID", "DEALER_NUM" };

GridButtonColumn selectColumn = new GridButtonColumn();

selectColumn.DataTextField =

"DEALER_NUM";

selectColumn.CommandArgument =

"DEALER_NUM";

selectColumn.CommandName =

"Select";

selectColumn.HeaderText =

"DealerNumber";

//selectColumn.

grdDealerList.MasterTableView.Columns.Add(selectColumn);

 

XmlDocument xmlDoc = new XmlDocument();

xmlDoc.Load(Request.MapPath(

"~/App_Data/DataMapping.xml"));

XmlNodeList columnNodeList = XML.GetNodeList("/DealerGrids/DealerGrid[@Name ='DealerList']/Columns/Column", xmlDoc);

 

foreach (XmlNode columnNode in columnNodeList)

{

string headerText = "";

headerText =

XML.GetAttributeValue("/Column", "DisplayText", columnNode.OuterXml);

if (headerText != null && headerText.Length > 0)

{

GridBoundColumn boundColumn = new GridBoundColumn();

boundColumn.DataField =

XML.GetAttributeValue("/Column", "TableColumnName", columnNode.OuterXml);

boundColumn.HeaderText = headerText;

grdDealerList.MasterTableView.Columns.Add(boundColumn);

}

}

this.PlaceHolder1.Controls.Add(grdDealerList);

}

}

XML :

<

DealerGrids>

<

DealerGrid Name="DealerList">

<

Columns>

<

Column TableColumnName="ROW_ID" DisplayText="" isDataKey="true" />

<

Column TableColumnName="DEALER_NUM" DisplayText="Dealer Number" isDataKey="true" />

<

Column TableColumnName="NAME" DisplayText="Dealer Name" isDataKey="true" />

<

Column TableColumnName="LEGAL_NAME" DisplayText="Legal Name" isDataKey="false" />

<

Column TableColumnName="SALES_DISTRICT" DisplayText="District" isDataKey="false" />

<

Column TableColumnName="BUSINESS_TYPE" DisplayText="Business Type" isDataKey="false" />

</

Columns>

</

DealerGrid>

</

DealerGrids>




             
Iana Tsolova
Telerik team
 answered on 15 Sep 2008
1 answer
95 views
hi to all,
i am using 2.8.4.0 version of rad combo box,
when i disabled the combo programatically it height and weight automatically increases.
waiting for a prompt reply from you.
Rosi
Telerik team
 answered on 15 Sep 2008
1 answer
92 views
I'm having a hard time trying to programatically add images to the panel bar.  I have read through formus for a few hours already.  This is pulled straight from an example.  Does not work for me.

<%

@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>


<telerik:RadPanelbar ID="RadPanelbar1" runat="server" Width="100%" Skin="Outlook" OnPanelItemDataBound="RadPanelbar1_OnPanelItemDataBound" ImagesBaseDir="~/img/" PersistStateInCookie="True">

</telerik:RadPanelbar>


Code behind

using

Telerik.Web.UI;


 

 //RadPanelbarPanelItemDataBoundEventArgs namespace can not be found!    I can't figure out why?
protected void RadPanelbar1_OnPanelItemDataBound(object sender,  RadPanelbarPanelItemDataBoundEventArgs e) 

{

if (!e.DataBoundDataRow.IsNull("Image"))

{

e.Item.ImageUrl = (

string)DataBinder.Eval(e.Item.DataItem, "image");

e.Item.ImageOverUrl = (

string)DataBinder.Eval(e.Item.DataItem, "image");

e.Item.ExpandedImageUrl = (

string)DataBinder.Eval(e.Item.DataItem, "image");

}

}




//Bind database to RadPanelBar.  This works

DataSet ds = new DataSet();

da.Fill(ds);

RadPanelbar1.DataSource = ds;

RadPanelbar1.DataFieldID =

"ID";

RadPanelbar1.DataFieldParentID =

"ParentID";

RadPanelbar1.DataTextField =

"Text";

RadPanelbar1.DataValueField =

"ID";

RadPanelbar1.DataNavigateUrlField =

"URL";

RadPanelbar1.DataBind();






Rosi
Telerik team
 answered on 15 Sep 2008
1 answer
125 views
Hello,

I have placed a pickerbutton inside a raddock, but when i click the button, the palette appear inside the dock causing it to show scrollbars (the dock is 200x200 px)

Is there a way to show the palette outside the dock?

Thank for the attention

Francesco
Sophy
Telerik team
 answered on 15 Sep 2008
3 answers
136 views
Hi,
       I have a scenario where i have a asp.net button which has a server click event. On click of that i will be parsing few folders and file structure and it will take bit time. Currenly my need is a way that which updates any of the asp.net control dynamically showing the user a status about the folder or file that is currently getting processed. To keep it simple assume there is a for loop which runs 2000 times and inside i print the counter value and this counter value has to be keep updated in a panel once the counter is incremented. something like this i require

processing ....1
processing ....2
processing ....3

..
..

processing ....2000

and finally it should exit. Currently the behaviour is once the click event returns it updates the value in my control visually. if i need the above requirement how to to do it using telerik ajax stuff. Please let me know if anything can help to satisfy my requirement.

Regards,
Elango

Sebastian
Telerik team
 answered on 15 Sep 2008
2 answers
113 views
I want to know is it's possible to changed the values of some textbox and dropdownlistbox fields when a select a value form an another dropdownlistbox in edit mode frorm a radgrid.

explanation: I have a grid containing a product number w(hich is a dropdownlistbox in edit mode), a description, mark, model unit_price (which they are textboxs) and Mesure_unit (which is a dropdownlistbox). 

If the client select a product number from the 1st dropdown i want to fill all the others fields with the value that i have in my database.

If the client don't select a product form de 1st dropdown they have to enter all the values for the others fields.

Is this possible

Thank you
Shinu
Top achievements
Rank 2
 answered on 15 Sep 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?