Jump to content
Software FX Community

StephenP

Members
  • Posts

    96
  • Joined

  • Last visited

Posts posted by StephenP

  1. Hey,

    Now I got it.  I found a way for you to prevent the item from deselecting when the button is clicked.  What you need to do to fix it now is set a property (OnClientClick) to your button.

    <asp:Button runat="server" OnClientClick="(new Sys.UI.DomEvent(event)).stopPropagation();" ID="btn1" onclick="btn1_Click" />

    That willl prevent the Click event from bubbling up to the cell, at which point will cause the deselection of the item.

    The upcoming service pack includes a new property, Grid.Selection.DeselectSingleItemOnClick, which will prevent an item from being deselected on click when its already selected.  That will do exactly what you want without having to modify the button.

    Have you used our CommandButton control?  It does what the regular button does but uses a callback instead of a postback.

    Highlight.zip

  2. Wow Chris, good find!  I'm gonna play with that over here.  We gzip our script files so I wonder if some kind of "double compression" is occuring that is causing the real problem.  If that's the case, I will include a way to disable our script compression so you can keep IIS's settings.  Thanks again!

  3. Hi,

    Thanks for the message.  You included all the information I needed, which is really helpful.

    I am trying to replicate the problem here.  With the latest version of Grid FX, I cannot reproduce this problem.  We have been doing some work actually to get Grid better integrated with SharePoint.  We will be releasing a service pack soon, but if you want to try it immediately, I could get a hotfix for you.  Would you like to try that?

  4. This is mainly a timing issue.  During the Rendering, the grid's client-side initialization script has already been committed to the page.  If you select an item after that, the client-side control will not know the first item is selected (the item is selected because the css classes are applied).  So when you click on another item the client-side control doesn't unselect the first because it has no idea the first one was selected.

    The easiest fix is to most your code to the Page's OnPreRenderComplete, such as:

    public partial class WebForm12 : System.Web.UI.Page

    {

    protected override void OnPreRenderComplete(EventArgs e)

    {

    Grid1.Items[0].Selected = true;base.OnPreRenderComplete(e);

    }

    Let me know if this helps.  Thanks again!

  5. Ken, the style property for the toolbar/pager container is missing from the current release.  However, it will be included in the upcoming service pack.  Can you wait a few weeks for that?  If not, I can help you with some kind of temporary css hack.

    post-5132-13922406312836_thumb.jpg

  6. Okay, so you are trying to update 2 "sibling" grids.  That's another story.  Unfortunately at this time, a grid that initiates a callback can only update within itself.  ASP.NET provides basically no support for more advanced updating within callbacks (UpdatePanels actually use postbacks, not callbacks, and are very heavy things).  We are in the process of improving this, and in upcoming releases of our products you will be able to update many separate controls during a callback.  Until then, you are best off just using a regular <asp:Button and handling its click event.  This will use a postback and although the flickering will occur, your problem should be solved.

    You may need to call DataBind on the second grid, because it has no official way to know that its data depends on another.

    Hope this helps!

  7. The client-side javascript is different for grids depending on their ID.  So, we include a server-side method that generates the javascript for you.  In VB, just enter: 

    Grid1.Commands.RefreshData.GetExecuteScript()

    Grid1 in that case is the grid in question.  It will spit out javascript like:

    GridFX.Grid.get_grids().Grid1.refreshData();That will do the trick.

  8. Nuts.  Right now grouping is done during data binding, between the DataBinding/ed events.  And so is the part where it generates the DataFields and Columns from the data schema.  I have submitted a task to provide an event that takes place after the DataFields/Columns generation.  This will be the event you can handle and adjust grouping to your heart's content.  This will be included in the next service pack, however if you can't wait I can issue a hotfix sometime next week.  It could introduce new instabilities, though.  Would that work for you or would you rather wait a month for the service pack?

  9. Yes, you can.  This is supported through the CommandButton control.  You can do it through our "Edit Layout" wizard by choosing "Add New" -> Command Button.  You can also do it in the property grid/markup.

    <GridFX:TemplateColumn>

    <HeaderTemplate><GridFX:CommandButton runat="server" ID="commandButton1" Command="AddSortField"

    Parameters=""transaction_id",0" />

    </HeaderTemplate>

    In this case, I set the command to sort by the "transaction_id" field.  If you edit the column's template (click on the column and choose Edit Template), the property grid for the CommandButton will give you a better way to set the properties. The Parameters is a string that's a JSON object, but the property grid presents it in a much nicer way.

  10. Tomasz,

    The auto-generated fields and columns will be fixed in our upcoming service pack, which is about 4 weeks away.  If you can't wait that long, I could get you a hotfix that solves the issue.  However, the best thing for you to do is to create the DataFields and Columns in the markup.  If you can do that, you should.  Otherwise, let me know exactly what you are desiring and we can work it out.

  11. In order for the Grid2 to exist, the item needs to be expanded.  However, the expansion happens after OnLoad.  There is an event on grid called ItemDetailsExpansionChanged.  Handle that event.  Check to see if the item is expanded via e.Expanded.  If that is true, the FindControlInTemplate should return the grid.  You can also do e.DetailsCell.FindControl in the event handler.

     Try that.  Let me know how it works out.

×
×
  • Create New...