in

CodeSmith Community

Your Code. Your Way. Faster!

SelectedDataKey is wrong when I filter

Last post 08-13-2007 6:05 PM by matt@kiwilamb.com. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 07-27-2007 12:22 AM

    • rduque
    • Top 75 Contributor
    • Joined on 03-08-2007
    • Bogotá, Colombia
    • Posts 61
    • Points 1,650

    SelectedDataKey is wrong when I filter

    Hi Listers.

    I'm having a problem when I used the GridViewSearchPanel ... If I filter it, the SelectedDataKeys of the EntityGridView in the GridView1_SelectedIndexChanged event are wrong but the filtered result are fine, then the filtered record in the xxxEdit.aspx are Wrong.

    I didn´t have this problem with an old Nettiers version .. now I'm using the 20070707.

    I clarity this problem began with a modified version ... the just generate version is fine !!!

    I just modified columns header, delete related entity panels/grids and GridViewSerachPanel but I cann´t find relation with this problem ... again I clarify this problem doesn´t occur with an old nettiers release.

     
    Any suggestion ?? 

    Thanks,

    RAUL DUQUE
    Bogotá, Colombia

    RAUL DUQUE
    Bogotá, Colombia
    • Post Points: 35
  • 07-27-2007 2:51 PM In reply to

    Re: SelectedDataKey is wrong when I filter

    Hi,

    The only checked in change to the GridViewSearchPanel after 7/7/07, was a change to add the NoWarn attribute to the template.  This should not have any affect whatsoever to the code.  The same thing holds true for the EntityGridView.

    Have you tried doing a file diff on the output of the two versions to see what has changed.  And also try checking that Typed Datasource that you're using as well.


    Robert Hinojosa

    -------------------------------------
    Member of the Codesmith Tools, .netTiers, teams

    http://www.nettiers.com
    -------------------------------------
    • Post Points: 35
  • 07-27-2007 4:49 PM In reply to

    • rduque
    • Top 75 Contributor
    • Joined on 03-08-2007
    • Bogotá, Colombia
    • Posts 61
    • Points 1,650

    Re: SelectedDataKey is wrong when I filter

    Thanks Robert ...

    I haven`t  done any change to the datasource class, I supposed this class (datasource) is the unique class Involved on the issue ... The EntityGridView haven´t been touch too ... then ...

     Regards
     

     
     

    RAUL DUQUE
    Bogotá, Colombia
    • Post Points: 35
  • 08-01-2007 9:47 AM In reply to

    • miles2t17
    • Not Ranked
    • Joined on 12-31-2005
    • Posts 4
    • Points 110

    Re: SelectedDataKey is wrong when I filter

    Did you ever solve this? I'm getting the same problem. I got around it by displaying the key as a column and accessing it by gridview1.Rows(g.SelectedIndex).Cells(1).Text

    This is not ideal since it isn't always good to display the id. For me it only happens when i have a

    <data:SqlParameter Name="WhereClause" UseParameterizedFilters="false">
                    <Filters>
                        <data:AmemAppFilter Column="Status" ControlID="lstStatus" />
                    </Filters>
                </data:SqlParameter>

     if I use <data:CustomParameter Name="WhereClause" Value="" ConvertEmptyStringToNull="false" /> The SelectedDataKey is populated fine, but I can't filter as easily.
     

    • Post Points: 35
  • 08-01-2007 5:07 PM In reply to

    • rduque
    • Top 75 Contributor
    • Joined on 03-08-2007
    • Bogotá, Colombia
    • Posts 61
    • Points 1,650

    Re: SelectedDataKey is wrong when I filter

    Thanks Miles, then It's a really issue, maybe some nettiers hacker can help us. Can you report to bugs thread?

    Thanks.

     
     

    RAUL DUQUE
    Bogotá, Colombia
    • Post Points: 35
  • 08-13-2007 6:05 PM In reply to

    Re: SelectedDataKey is wrong when I filter

    Did you ever get a solution to this as I'm experiancing the same problem going from v2.0.1 to 2.2

    protected void GridView_SelectedIndexChanged(object sender, EventArgs e)

    {

    string urlParams = string.Format("Pk={0}", GridView1.SelectedDataKey.Values[0]);

    throwing a exception...

       at _YBC_Syndicator_Sections.GridView_SelectedIndexChanged(Object sender, EventArgs e) in c:\Documents and Settings\MJLamb\My Documents\My Projects\yBC\yBC.WebSite\Admin\_YBC_Syndicator_Sections.aspx.cs:line 54
       at System.Web.UI.WebControls.GridView.OnSelectedIndexChanged(EventArgs e)
       at System.Web.UI.WebControls.GridView.HandleSelect(Int32 rowIndex)
       at System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup)
       at System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 

     

    Filed under: , ,
    • Post Points: 5
Page 1 of 1 (6 items)
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems