S
settyv
Hi,
I am using DataGrid control and am binding to the Dataset that is
returned from Business layer.
Now the problem is that am using hyperlink column for CaseID which is
displaying twice in the grid.
But it should not be like that.What could be the problem? Any idea.
Here is the code below:
CaseSearch.aspx
<asp:datagrid id="grdCaseSearch" Width="800" Runat="server"
Headerstyle-BackColor="#9B9BB4" AllowPaging="True"
OnPageIndexChanged="NewPage" PagerStyle-Mode="NextPrev"
PagerStyle-NextPageText="Next" PagerStyle-PrevPageText="Previous"
Font-Name="verdana" AllowCustomPaging="false"
AllowSorting="true" HeaderStyle-CssClass="tableheader"
HeaderStyle-ForeColor="#000000" HeaderStyle-Font-Bold="True">
<AlternatingItemStyle BackColor="#e2e2e2" Font-Name="verdana"
/>
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="Case Number"
DataNavigateUrlFormatString="CaseInformationSummary.aspx?CaseN0={0}"
DataTextField="Case Number" HeaderText="Case
Number"></asp:HyperLinkColumn>
</Columns>
</asp:datagrid>
CaseSearch.aspx.cs
Here is the method am calling :
public void DisplayCaseSearchResults()
{
DataSet ds;
SearchParams sp=new SearchParams ();
lblResultCase.Visible=true;
sp.CaseCatCode=ddlCaseCategory.SelectedItem.Value;
if(txtToFiledDate.Text.ToString()!="" &&
txtFromFiledDate.Text.ToString()!="" )
{
sp.FiledTo = DateTime.Parse(txtToFiledDate.Text);
sp.FiledFrom = DateTime.Parse(txtFromFiledDate.Text);
}
if(txtToFiledDate.Text.ToString()=="")
{
sp.FiledTo = new DateTime(0);
}
if(txtFromFiledDate.Text.ToString()=="")
{
sp.FiledFrom = new DateTime(0);
}
sp.FirstName = txtFirstName.Text;
sp.MiddleName = txtMidName.Text ;
sp.LastName = txtLastName.Text;
sp.Organization = txtBusinessEntity.Text;
if (txtSearchCase.Text.ToString() == "")
{
if(txtCaseNo1.Text.ToString()=="" ||
txtCaseNo2.Text.ToString()=="")
sp.DisplayCaseNum = null;
else
sp.DisplayCaseNum=txtCaseNo.Text + "-" + txtCaseNo1.Text + "-" +
txtCaseNo2.Text ;
}
else
sp.DisplayCaseNum = txtSearchCase.Text;
//sp.DispositionDate=DateTime.MinValue;
//Call BL for getting CaseSearchDataset
Case BCase=new Case ();
BCase.SearchCases(sp,out ds);
grdCaseSearch.DataSource =ds;
grdCaseSearch.DataBind();
}
Please let me know how can i solve this issue.
Thanks,
Vishnu
I am using DataGrid control and am binding to the Dataset that is
returned from Business layer.
Now the problem is that am using hyperlink column for CaseID which is
displaying twice in the grid.
But it should not be like that.What could be the problem? Any idea.
Here is the code below:
CaseSearch.aspx
<asp:datagrid id="grdCaseSearch" Width="800" Runat="server"
Headerstyle-BackColor="#9B9BB4" AllowPaging="True"
OnPageIndexChanged="NewPage" PagerStyle-Mode="NextPrev"
PagerStyle-NextPageText="Next" PagerStyle-PrevPageText="Previous"
Font-Name="verdana" AllowCustomPaging="false"
AllowSorting="true" HeaderStyle-CssClass="tableheader"
HeaderStyle-ForeColor="#000000" HeaderStyle-Font-Bold="True">
<AlternatingItemStyle BackColor="#e2e2e2" Font-Name="verdana"
/>
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="Case Number"
DataNavigateUrlFormatString="CaseInformationSummary.aspx?CaseN0={0}"
DataTextField="Case Number" HeaderText="Case
Number"></asp:HyperLinkColumn>
</Columns>
</asp:datagrid>
CaseSearch.aspx.cs
Here is the method am calling :
public void DisplayCaseSearchResults()
{
DataSet ds;
SearchParams sp=new SearchParams ();
lblResultCase.Visible=true;
sp.CaseCatCode=ddlCaseCategory.SelectedItem.Value;
if(txtToFiledDate.Text.ToString()!="" &&
txtFromFiledDate.Text.ToString()!="" )
{
sp.FiledTo = DateTime.Parse(txtToFiledDate.Text);
sp.FiledFrom = DateTime.Parse(txtFromFiledDate.Text);
}
if(txtToFiledDate.Text.ToString()=="")
{
sp.FiledTo = new DateTime(0);
}
if(txtFromFiledDate.Text.ToString()=="")
{
sp.FiledFrom = new DateTime(0);
}
sp.FirstName = txtFirstName.Text;
sp.MiddleName = txtMidName.Text ;
sp.LastName = txtLastName.Text;
sp.Organization = txtBusinessEntity.Text;
if (txtSearchCase.Text.ToString() == "")
{
if(txtCaseNo1.Text.ToString()=="" ||
txtCaseNo2.Text.ToString()=="")
sp.DisplayCaseNum = null;
else
sp.DisplayCaseNum=txtCaseNo.Text + "-" + txtCaseNo1.Text + "-" +
txtCaseNo2.Text ;
}
else
sp.DisplayCaseNum = txtSearchCase.Text;
//sp.DispositionDate=DateTime.MinValue;
//Call BL for getting CaseSearchDataset
Case BCase=new Case ();
BCase.SearchCases(sp,out ds);
grdCaseSearch.DataSource =ds;
grdCaseSearch.DataBind();
}
Please let me know how can i solve this issue.
Thanks,
Vishnu