Giriş Yap Kayıt ol Online Üyeler Aktif Konular Arama Üyeler Forum Kuralları
Tahribat.Com | Grid Kontrolu Acil Yardim
Tahribat.Com Forumları
Asp.Net - C#.Net - J#.Net - Vb.Net
      Grid Kontrolu Acil Yardim
Bu Bölümde yeni konu açmak için tıklayın Konuyu cevaplamak için tık...
Konu 3 Ekim 2010 (Pazar) 21:16 tarihinde açıldı. Kısayol | Alıntı yap | Özel Mesaj
kanvegul


Kayıt : 2 Haziran 2002
KVG
Erkek Üye
 

Merhaba arkadaslar

 

asp.net 2.0 bir grid islemi yapiyorum . webgrid controlunu kullaniyorum fakat grid uzerinde sag tiklayinca menu geliyor onu engellemek istiyorum veya menuden bazi linkleri silmek istiyorum fakat olmuyor reflectorle dll actim fakat isin icinden cikamadim menu kontrolunun reflectorle acilmis kodu asagida jQuery yazilmis bir kontrol. kirmizi ile isaret ettigim yeri iptal emek istiyorum mesela ama olmuyor veya menuyu iptal etmek istiyorum oda olmuyor

Grid1.Scripts.DisableContextMenu = false gibi kodu var kod yaziliminda sorun yok ama calistirinca projeyi hata veriyor.jQuery ile mudale edersek nasil ederiz. ve asp.net nasil ekleyebilirim

yardimci olursaniz sevinirim

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 44:     Grid1.DataBind();
Line 45:
Line 46: Grid1.Scripts.DisableContextMenu = false;
Line 47: //WebGrid.ScriptSettings.DisableThickBox
Line 48: //Grid1.ContextMenu.Visible = false;

Source File: e:\Documents and Settings\TLT\Belgelerim\Visual Studio 2008\WebSites\WebSite1\Default.aspx.cs    Line: 46

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
_Default.Page_Load(Object sender, EventArgs e) in e:\Documents and Settings\TLT\Belgelerim\Visual Studio 2008\WebSites\WebSite1\Default.aspx.cs:46
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433



menu%20sorunu


if(jQuery)( function() {
    $.extend($.fn, {
       
        contextMenu: function(o, callback) {
            // Defaults
            if( o.menu == undefined ) return false;
            if( o.inSpeed == undefined ) o.inSpeed = 150;
            if( o.outSpeed == undefined ) o.outSpeed = 75;
            // 0 needs to be -1 for expected results (no fade)
            if( o.inSpeed == 0 ) o.inSpeed = -1;
            if( o.outSpeed == 0 ) o.outSpeed = -1;
            // Loop each context menu
            $(this).each( function() {
                var el = $(this);
                var offset = $(el).offset();
                // Add contextMenu class
                $('#' + o.menu).addClass('contextMenu');
                // Simulate a true right click
                $(this).mousedown( function(e) {
                    var evt = e;
                    $(this).mouseup( function(e) {
                        var srcElement = $(this);
                        $(this).unbind('mouseup');
                        if( evt.button == 2 ) {
                            // Hide context menus that may be showing
                            $(".contextMenu").hide();
                            // Get this context menu
                            var menu = $('#' + o.menu);
                           
                            if( $(el).hasClass('disabled') ) return false;
                           
                            // Detect mouse position
                            var d = {}, x, y;
                            if( self.innerHeight ) {
                                d.pageYOffset = self.pageYOffset;
                                d.pageXOffset = self.pageXOffset;
                                d.innerHeight = self.innerHeight;
                                d.innerWidth = self.innerWidth;
                            } else if( document.documentElement &&
                                document.documentElement.clientHeight ) {
                                d.pageYOffset = document.documentElement.scrollTop;
                                d.pageXOffset = document.documentElement.scrollLeft;
                                d.innerHeight = document.documentElement.clientHeight;
                                d.innerWidth = document.documentElement.clientWidth;
                            } else if( document.body ) {
                                d.pageYOffset = document.body.scrollTop;
                                d.pageXOffset = document.body.scrollLeft;
                                d.innerHeight = document.body.clientHeight;
                                d.innerWidth = document.body.clientWidth;
                            }
                            (e.pageX) ? x = e.pageX : x = e.clientX + d.scrollLeft;
                            (e.pageY) ? y = e.pageY : x = e.clientY + d.scrollTop;
                           
                            // Show the menu
                            $(document).unbind('click');
                            $(menu).css({ top: y, left: x }).fadeIn(o.inSpeed);
                            // Hover events
                            $(menu).find('A').mouseover( function() {
                                $(menu).find('LI.hover').removeClass('hover');
                                $(this).parent().addClass('hover');
                            }).mouseout( function() {
                                $(menu).find('LI.hover').removeClass('hover');
                            });
                           
                            // Keyboard
                            $(document).keypress( function(e) {
                                switch( e.keyCode ) {
                                    case 38: // up
                                        if( $(menu).find('LI.hover').size() == 0 ) {
                                            $(menu).find('LI:last').addClass('hover');
                                        } else {
                                            $(menu).find('LI.hover').removeClass('hover').prevAll('LI:not(.disabled)').eq(0).addClass('hover');
                                            if( $(menu).find('LI.hover').size() == 0 ) $(menu).find('LI:last').addClass('hover');
                                        }
                                    break;
                                    case 40: // down
                                        if( $(menu).find('LI.hover').size() == 0 ) {
                                            $(menu).find('LI:first').addClass('hover');
                                        } else {
                                            $(menu).find('LI.hover').removeClass('hover').nextAll('LI:not(.disabled)').eq(0).addClass('hover');
                                            if( $(menu).find('LI.hover').size() == 0 ) $(menu).find('LI:first').addClass('hover');
                                        }
                                    break;
                                    case 13: // enter
                                        $(menu).find('LI.hover A').trigger('click');
                                    break;
                                    case 27: // esc
                                        $(document).trigger('click');
                                    break
                                }
                            });
                           
                            // When items are selected
                            $('#' + o.menu).find('A').unbind('click');
                            $('#' + o.menu).find('LI:not(.disabled) A').click( function() {
                                $(document).unbind('click').unbind('keypress');
                                $(".contextMenu").hide();
                                // Callback
                                if( callback ) callback( $(this).attr('href').substr(1), $(srcElement), {x: x - offset.left, y: y - offset.top, docX: x, docY: y} );
                                return false;
                            });
                           
                            // Hide bindings
                            setTimeout( function() { // Delay for Mozilla
                                $(document).click( function() {
                                    $(document).unbind('click').unbind('keypress');
                                    $(menu).fadeOut(o.outSpeed);
                                    return false;
                                });
                            }, 0);
                        }
                    });
                });
               
                // Disable text selection
                if( $.browser.mozilla ) {
                    $('#' + o.menu).each( function() { $(this).css({ 'MozUserSelect' : 'none' }); });
                } else if( $.browser.msie ) {
                    $('#' + o.menu).each( function() { $(this).bind('selectstart.disableTextSelect', function() { return false; }); });
                } else {
                    $('#' + o.menu).each(function() { $(this).bind('mousedown.disableTextSelect', function() { return false; }); });
                }
                // Disable browser context menu (requires both selectors to work in IE/Safari + FF/Chrome)
                $(el).add('UL.contextMenu').bind('contextmenu', function() { return false; });
               
            });
            return $(this);
        },
       
        // Disable context menu items on the fly
        disableContextMenuItems: function(o) {
            if( o == undefined ) {
                // Disable all
                $(this).find('LI').addClass('disabled');
                return( $(this) );
            }
            $(this).each( function() {
                if( o != undefined ) {
                    var d = o.split(',');
                    for( var i = 0; i < d.length; i++ ) {
                        $(this).find('A[href="' + d[i] + '"]').parent().addClass('disabled');
                       
                    }
                }
            });
            return( $(this) );
        },
       
        // Enable context menu items on the fly
        enableContextMenuItems: function(o) {
            if( o == undefined ) {
                // Enable all
                $(this).find('LI.disabled').removeClass('disabled');
                return( $(this) );
            }
            $(this).each( function() {
                if( o != undefined ) {
                    var d = o.split(',');
                    for( var i = 0; i < d.length; i++ ) {
                        $(this).find('A[href="' + d[i] + '"]').parent().removeClass('disabled');
                       
                    }
                }
            });
            return( $(this) );
        },
       
        // Disable context menu(s)
        disableContextMenu: function() {
            $(this).each( function() {
                $(this).addClass('disabled');
            });
            return( $(this) );
        },
       
        // Enable context menu(s)
        enableContextMenu: function() {
            $(this).each( function() {
                $(this).removeClass('disabled');
            });
            return( $(this) );
        },
       
        // Destroy context menu(s)
        destroyContextMenu: function() {
            // Destroy specified context menus
            $(this).each( function() {
                // Disable action
                $(this).unbind('mousedown').unbind('mouseup');
            });
            return( $(this) );
        }
       
    });
})(jQuery);


http://img193.imageshack.us/img193/103/p1080725.jpg 
3 Ekim 2010 (Pazar) 21:29 tarihinde yazıldı. Kısayol | Alıntı yap | Özel Mesaj
kanvegul


Kayıt : 2 Haziran 2002
KVG
Erkek Üye
 

up


http://img193.imageshack.us/img193/103/p1080725.jpg 
3 Ekim 2010 (Pazar) 22:16 tarihinde yazıldı. Kısayol | Alıntı yap | Özel Mesaj
crafty


Kayıt : 19 Eylül 2006
Adana
Erkek Üye
 

hacı jscript ile sağ tıklamayı engelleyebilirsin nasıl kullanacağın vs. zaten kodları veren sitelerde yazıyor... anladığım kadarıya veritabanından veri çekip onları gridde listeliyorsun da bunun için gridview i neden kullanmıyorsun webgrid in özelliği nedir?


yalnız ama mutlu insan... 
3 Ekim 2010 (Pazar) 23:04 tarihinde yazıldı. Kısayol | Alıntı yap | Özel Mesaj
kanvegul


Kayıt : 2 Haziran 2002
KVG
Erkek Üye
 

crafty bunu yazdı:
-----------------------------

hacı jscript ile sağ tıklamayı engelleyebilirsin nasıl kullanacağın vs. zaten kodları veren sitelerde yazıyor... anladığım kadarıya veritabanından veri çekip onları gridde listeliyorsun da bunun için gridview i neden kullanmıyorsun webgrid in özelliği nedir?


-----------------------------

hocam webgrid hazir kontrol 10 gundur bu kontrolle ugrasiyorum ajax bir kontrol ama sadece about kismini kaldiramadim onuda halledersem her yerde kullanilabirli bir kontrol olacak


http://img193.imageshack.us/img193/103/p1080725.jpg 
3 Ekim 2010 (Pazar) 23:31 tarihinde yazıldı. Kısayol | Alıntı yap | Özel Mesaj
kanvegul


Kayıt : 2 Haziran 2002
KVG
Erkek Üye
 

tamam buldum tesekkurler

 


http://img193.imageshack.us/img193/103/p1080725.jpg 
3 Ekim 2010 (Pazar) 23:33 tarihinde yazıldı. Kısayol | Alıntı yap | Özel Mesaj
crafty


Kayıt : 19 Eylül 2006
Adana
Erkek Üye
 

hacı nasıl bulduğunu da yazda buraya hiç olmassa yarın birgün aynı dertten muzdarip kişiler formda arama yaptığı zaman nasıl yapıldığını bulabilsin...


yalnız ama mutlu insan... 
4 Ekim 2010 (Pazartesi) 01:36 tarihinde yazıldı. Kısayol | Alıntı yap | Özel Mesaj
kanvegul


Kayıt : 2 Haziran 2002
KVG
Erkek Üye
 

  <ContextMenu  >
               <WG:SystemMenuItem id="about" MenuType="About" Visible="false"/>
                 <WG:SystemMenuItem id="help" MenuType="Help" Visible="false"/>
                     <WG:SystemMenuItem id="CollapsedGrid" MenuType="CollapsedGrid" Visible="false"/>
                      <WG:SystemMenuItem id="Export" MenuType="Export" Text="Excel Aktar" CssClass="wgcontextmenuexport separator"/>
                       <WG:SystemMenuItem id="Print" MenuType="Print" Text="Yazdır" CssClass="wgcontextmenuprint"/>
                        <WG:SystemMenuItem id="Refresh" MenuType="Refresh" Text="Yenile" CssClass="wgcontextmenurefresh"/>
              
               </ContextMenu>

 

ile gridin icine yazarak cozuluyor hocam


http://img193.imageshack.us/img193/103/p1080725.jpg 

[1]


Bu Bölümde yeni konu açmak için dıklayın Konuyu cevaplamak için tık...
Allah'a Havale Et Google Bookmark'a Ekle Yahoo'ya Ekle Stumbleupon'a Ekle Facebook'a Ekle Twitter'a Ekle   Google'da Ara : grid kontrolu acil yardim Favorilerime Ekle Yukarı Çık
Konuda 7 Mesaj Var.
Konu 574 Sefer Gösterilmiş.
2001-2012 © Tahribat Group - Her Hakkı Saklıdır. - ● Gizlilik İlkeleri ● Kullanım Koşulları ● İletişim