Click here to Skip to main content
15,896,154 members
Home / Discussions / C#
   

C#

 
GeneralRe: Error in WPF Pin
Pete O'Hanlon18-Jun-13 0:50
mvePete O'Hanlon18-Jun-13 0:50 
GeneralRe: Error in WPF Pin
Nick_Frenk18-Jun-13 2:33
Nick_Frenk18-Jun-13 2:33 
GeneralRe: Error in WPF Pin
Nick_Frenk19-Jun-13 3:13
Nick_Frenk19-Jun-13 3:13 
QuestionRead & Write Binary Data File Pin
Jassim Rahma16-Jun-13 9:34
Jassim Rahma16-Jun-13 9:34 
AnswerRe: Read & Write Binary Data File Pin
Pete O'Hanlon16-Jun-13 9:44
mvePete O'Hanlon16-Jun-13 9:44 
GeneralRe: Read & Write Binary Data File Pin
harold aptroot16-Jun-13 10:11
harold aptroot16-Jun-13 10:11 
AnswerRe: Read & Write Binary Data File Pin
V.16-Jun-13 21:20
professionalV.16-Jun-13 21:20 
QuestionCustom gridview showing more rows than data Pin
Shelts15-Jun-13 7:10
Shelts15-Jun-13 7:10 
I have an issue with a custom gridview. Source code is from the PagingGridView located on this site. I have tried several paging gridivews but keep running into the same problem which leads me to believe that the issue is not related to the gridview, but perhaps viewstate. When I bind the gridview it shows up properly on the page. As I scroll from page to page, it works properly. The problem exists when I get to the last page of records. If the total records in the DataSource is less than the Page size, the gridview binds correctly, however a postback will cause blank rows to show up beneath the correctly bound entries of the gridview. Wierd... I am using LINQ with Entitiy framework to get data from the database. All of this seems to work correctly, its just these blank rows that keep appearing.

Example markup:

<custom:gridview id="SearchResultsGridview" runat="server" showheaderwhenempty="true" onpageindexchanging="SearchResultsGridview_Paging" onselectedindexchanging="SearchResultsGridview_Selection" autogenerateselectbutton="True" allowpaging="true" allowcustompaging="true" pagesize="15" autogeneratecolumns="False" datakeynames="FactoryId,InlineId" cssclass="mGrid" headerstyle-cssclass="hed" alternatingrowstyle-cssclass="alt" pagerstyle-cssclass="pgr" selectedrowstyle-cssclass="sel">
<columns>
<asp:boundfield datafield="InlineId" headertext="Inspection Id">
<asp:boundfield datafield="FactoryId" headertext="" visible="false">
<asp:boundfield datafield="CreateById" headertext="" visible="false">
<asp:boundfield datafield="FactoryName" headertext="Factory Name">
<asp:boundfield datafield="CreateByName" headertext="Created By">
<asp:boundfield datafield="CreateDate" headertext="Date Created">




Example of binding procedure:

C#
protected void SearchResultsGridview_Bind(int PageIndex)
        {
            var _Fetcher = new InlineInspectionRepository.PageablePermissionRestrictedInlineInspections();

            _Fetcher.AccountId = Convert.ToInt32(_Account.AccountId);
            _Fetcher.MerchandiseOrganizationId = Convert.ToInt32(MerchandiseOrganizationList.SelectedValue);
            _Fetcher.MerchandiseGroupId = Convert.ToInt32(MerchandiseGroupList.SelectedValue);
            _Fetcher.MerchandiseDivisionId = Convert.ToInt32(MerchandiseDivisionList.SelectedValue);
            _Fetcher.FactoryId = Converter.ConvertToInt32(FactoryIdField.Value);
            _Fetcher.OrderNumber = OrderNumberField.Text;
            _Fetcher.StyleNumber = StyleNumberField.Text;
            _Fetcher.InlineId = Converter.ConvertToInt32(InspectionIdField.Text);
            _Fetcher.InspectionStartDate = null;
            _Fetcher.InspectionEndDate = null;
            _Fetcher.StartPosition = (PageIndex * SearchResultsGridview.PageSize) + 1;
            _Fetcher.EndPosition = ((PageIndex * SearchResultsGridview.PageSize) + 1) + (SearchResultsGridview.PageSize - 1);

            if (InspectionStartDateField.Text != "") {
                _Fetcher.InspectionStartDate = Convert.ToDateTime(InspectionStartDateField.Text);
            }

            if (InspectionEndDateField.Text != "") {
                _Fetcher.InspectionEndDate = Convert.ToDateTime(InspectionEndDateField.Text);
            }

            SearchResultsGridview.DataSource = _Fetcher.Execute();
            SearchResultsGridview.VirtualItemCount = _Fetcher.Count;
            //SearchResultsGridview.PageIndex = PageIndex;
            //SearchResultsGridview.CurrentPageIndex = PageIndex;
            //SearchResultsGridview.SelectedIndex = -1;
            SearchResultsGridview.DataBind();

            if (SearchResultsGridview.VirtualItemCount == 0)
            {
                Page_Notify("No inspections were found matching the selected criteria");
            }
        }

Questionmachine learning c# web service and web site Pin
miren gomez14-Jun-13 4:34
miren gomez14-Jun-13 4:34 
AnswerRe: machine learning c# web service and web site Pin
Pete O'Hanlon14-Jun-13 4:50
mvePete O'Hanlon14-Jun-13 4:50 
AnswerRe: machine learning c# web service and web site Pin
Alan Balkany14-Jun-13 4:59
Alan Balkany14-Jun-13 4:59 
AnswerRe: machine learning c# web service and web site Pin
Dave Kreskowiak14-Jun-13 7:28
mveDave Kreskowiak14-Jun-13 7:28 
GeneralRe: machine learning c# web service and web site Pin
miren gomez14-Jun-13 7:55
miren gomez14-Jun-13 7:55 
GeneralRe: machine learning c# web service and web site Pin
Pete O'Hanlon14-Jun-13 8:17
mvePete O'Hanlon14-Jun-13 8:17 
GeneralRe: machine learning c# web service and web site Pin
miren gomez14-Jun-13 8:36
miren gomez14-Jun-13 8:36 
GeneralRe: machine learning c# web service and web site Pin
NotPolitcallyCorrect14-Jun-13 8:49
NotPolitcallyCorrect14-Jun-13 8:49 
GeneralRe: machine learning c# web service and web site Pin
Pete O'Hanlon14-Jun-13 8:49
mvePete O'Hanlon14-Jun-13 8:49 
GeneralRe: machine learning c# web service and web site Pin
miren gomez14-Jun-13 9:01
miren gomez14-Jun-13 9:01 
GeneralRe: machine learning c# web service and web site Pin
Pete O'Hanlon14-Jun-13 9:03
mvePete O'Hanlon14-Jun-13 9:03 
GeneralRe: machine learning c# web service and web site Pin
miren gomez14-Jun-13 9:08
miren gomez14-Jun-13 9:08 
GeneralRe: machine learning c# web service and web site Pin
Pete O'Hanlon14-Jun-13 9:37
mvePete O'Hanlon14-Jun-13 9:37 
GeneralRe: machine learning c# web service and web site Pin
miren gomez14-Jun-13 9:42
miren gomez14-Jun-13 9:42 
GeneralRe: machine learning c# web service and web site Pin
Pete O'Hanlon14-Jun-13 9:48
mvePete O'Hanlon14-Jun-13 9:48 
QuestionMemoryMappedFiles / MemoryMappedViewAccessor Pin
Member 333503214-Jun-13 3:18
Member 333503214-Jun-13 3:18 
AnswerRe: MemoryMappedFiles / MemoryMappedViewAccessor Pin
Dave Kreskowiak14-Jun-13 7:24
mveDave Kreskowiak14-Jun-13 7:24 

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.