Click here to Skip to main content
15,927,127 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: I want to refresh only a control Pin
Not Active23-Jan-07 3:31
mentorNot Active23-Jan-07 3:31 
GeneralRe: I want to refresh only a control Pin
indian14323-Jan-07 3:35
indian14323-Jan-07 3:35 
GeneralRe: I want to refresh only a control Pin
Not Active23-Jan-07 3:48
mentorNot Active23-Jan-07 3:48 
GeneralRe: I want to refresh only a control Pin
indian14323-Jan-07 17:50
indian14323-Jan-07 17:50 
AnswerRe: I want to refresh only a control Pin
gauthee23-Jan-07 21:27
gauthee23-Jan-07 21:27 
GeneralRe: I want to refresh only a control Pin
indian14323-Jan-07 22:02
indian14323-Jan-07 22:02 
Questionhow to sign the cookie secure ? Pin
King Shez23-Jan-07 0:53
King Shez23-Jan-07 0:53 
QuestionOnRowCommand doesn't work properly with Sorting Pin
Omkar Ghaisas23-Jan-07 0:19
Omkar Ghaisas23-Jan-07 0:19 
Hi,
I am facing this unique problem which can be explained only with the code below
<code>
protected void grdQueryList_RowCommand(object sender, GridViewCommandEventArgs e)
{
string Sugg_Id;

if (e.CommandName == "View")
{
Sugg_Id = dv.Table.Rows[Convert.ToInt32(e.CommandArgument)][1].ToString();
Response.Redirect("Feedback_Data.aspx?Sugg_Id=" + Sugg_Id);
}
}

protected void grdQueryList_RowDataBound(object sender, GridViewRowEventArgs e)
{
//if (e.Row.RowType == DataControlRowType.DataRow || e.Row.RowType == DataControlRowType.Header)
// {
// e.Row.Cells[1].Visible = false; // Hiding the SUGG ID COLUMN
// }

if (e.Row.RowType == DataControlRowType.DataRow)
{
RowIndex += 1;
e.Row.Cells[0].Text = Convert.ToString(RowIndex);
}

if (e.Row.RowType == DataControlRowType.Header)
{

TableCellCollection cells = e.Row.Cells;

foreach (TableCell cell in cells)
{
if (!(cell.Text.Contains("VIEW") || cell.Text.Contains("SR NO")))
{
cell.Text = Server.HtmlDecode(GenerateScript(cell.Text, grdQueryList));
}
}
}
}

protected void grdQueryList_Sorting(object sender, GridViewSortEventArgs e)
{
string sortExpression = e.SortExpression;

if (GridViewSortDirection == SortDirection.Ascending)
{
GridViewSortDirection = SortDirection.Descending;
RowIndex = 0;
SortGridView(sortExpression, " DESC");
}
else
{
GridViewSortDirection = SortDirection.Ascending;
RowIndex = 0;
SortGridView(sortExpression, " ASC");
}
}

private void SortGridView(string sortExpression, string direction)
{
DataSet objQueriesData;

objQueriesData = BusinessClass.GetQueriesList();
dv = new DataView(objQueriesData.Tables[0]);

if (sortExpression != "" && direction != "")
{
dv.Sort = sortExpression + direction;
}

grdQueryList.DataSource = dv;
grdQueryList.DataBind( );
}

private string GenerateScript(string columnName, GridView gv)
{
string optionalParam = "Sort$" + columnName;

StringBuilder sb = new StringBuilder( );
sb.Append("<a style='color:Black' href=\"");
sb.Append("javascript:");
sb.Append(ClientScript.GetPostBackEventReference
(gv, optionalParam, false));
sb.Append("\">");
sb.Append(columnName);
sb.Append("</a>");

return sb.ToString( );

}

public SortDirection GridViewSortDirection
{

get
{

if (ViewState["sortDirection"] == null)

ViewState["sortDirection"] = SortDirection.Ascending;

return (SortDirection)ViewState["sortDirection"];

}

set
{
ViewState["sortDirection"] = value;
}

}
</code>

Now the problem is that, whenever user sorts data in the grid using Hyperlink Header, the data gets sorted properly, but when a RowCommand is fired, then the e.commandArgument shows 0th row being picked, but the value picked from one of the cells is from some other row instead of Row 0.
How to track or solve this ?
Pls guide
Thanks and best regards
Omkar Ghaisas
Questionproblem in commit &amp; roll back [modified] Pin
micydon22-Jan-07 23:58
micydon22-Jan-07 23:58 
QuestionSetting Logical Path for ASP.NET [modified] Pin
anandhakumar22-Jan-07 23:34
anandhakumar22-Jan-07 23:34 
AnswerRe: Setting Logical Path for ASP.NET Pin
Declan Bright23-Jan-07 4:13
Declan Bright23-Jan-07 4:13 
GeneralRe: Setting Logical Path for ASP.NET Pin
anandhakumar23-Jan-07 18:50
anandhakumar23-Jan-07 18:50 
Questiontag Pin
Uma Kameswari22-Jan-07 22:52
Uma Kameswari22-Jan-07 22:52 
AnswerRe: tag Pin
Parwej Ahamad22-Jan-07 23:23
professionalParwej Ahamad22-Jan-07 23:23 
AnswerRe: tag Pin
RichardGrimmer23-Jan-07 1:24
RichardGrimmer23-Jan-07 1:24 
Questioncontext menu on webpage Pin
dalbhide bipin22-Jan-07 22:06
dalbhide bipin22-Jan-07 22:06 
AnswerRe: context menu on webpage Pin
Swapnil Piparia22-Jan-07 23:05
Swapnil Piparia22-Jan-07 23:05 
GeneralRe: context menu on webpage Pin
dalbhide bipin22-Jan-07 23:11
dalbhide bipin22-Jan-07 23:11 
GeneralRe: context menu on webpage Pin
Swapnil Piparia22-Jan-07 23:36
Swapnil Piparia22-Jan-07 23:36 
GeneralRe: context menu on webpage Pin
dalbhide bipin22-Jan-07 23:53
dalbhide bipin22-Jan-07 23:53 
GeneralRe: context menu on webpage Pin
Swapnil Piparia23-Jan-07 2:03
Swapnil Piparia23-Jan-07 2:03 
Questioni want to refresh the page of asp.net without blinking. Pin
sathyan_829422-Jan-07 21:57
sathyan_829422-Jan-07 21:57 
AnswerRe: i want to refresh the page of asp.net without blinking. Pin
Guffa22-Jan-07 22:25
Guffa22-Jan-07 22:25 
Questionwhat is the solution Pin
sathyan_829422-Jan-07 21:56
sathyan_829422-Jan-07 21:56 
AnswerRe: what is the solution Pin
kirthikirthi23-Jan-07 0:23
kirthikirthi23-Jan-07 0:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.